* { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    color: var(--color-ink);
    background:
      radial-gradient(circle at 57% 23%, rgba(255,151,72,.075), transparent 29rem),
      linear-gradient(180deg, var(--color-bg), var(--color-bg-soft));
    font: var(--font-size-md)/var(--line-normal) var(--font-sans);
  }
  button, input { font: inherit; }
  a { color: inherit; text-decoration: none; }
  :focus-visible { outline: .18rem solid rgba(184,78,0,.72); outline-offset: .2rem; }
  .sr-only {
    width: 1px; height: 1px; padding: 0; margin: -1px;
    position: absolute; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }



  .site-header {
    height: var(--header-height);
    padding: 0 var(--page-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(117,102,94,.08);
    background: rgba(255,253,251,.82);
    backdrop-filter: blur(18px);
  }

  .mobile-nav {
    display: none;
    position: fixed;
    z-index: 45;
    inset: var(--header-height) 0 auto;
    padding: 1.2rem var(--page-pad) 1.5rem;
    border-bottom: 1px solid var(--color-line);
    background: rgba(255,253,251,.97);
    box-shadow: var(--shadow-card);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a {
    padding: .8rem 0;
    display: block;
    border-bottom: 1px solid rgba(117,102,94,.09);
  }

  .hero {
    width: min(100%, var(--page-max));
    min-height: calc(100vh - var(--header-height));
    margin: 0 auto;
    padding: clamp(3.5rem,7vh,6.4rem) var(--page-pad) var(--space-12);
    display: grid;
    grid-template-columns: minmax(20rem, .93fr) minmax(31rem, 1.35fr) minmax(16.5rem, .65fr);
    grid-template-rows: minmax(31rem, auto) auto auto;
    gap: 1.2rem 1.8rem;
    position: relative;
    overflow: clip;
  }
  .hero::before,
  .hero::after {
    content: "";
    width: 62rem;
    height: 24rem;
    position: absolute;
    left: 29%;
    top: 3.5rem;
    border: 1px solid rgba(255,122,34,.13);
    border-radius: 50%;
    transform: rotate(11deg);
    pointer-events: none;
  }
  .hero::after {
    width: 68rem;
    height: 20rem;
    top: 5.2rem;
    border-color: rgba(159,145,137,.09);
    transform: rotate(-8deg);
  }

  .hero-copy {
    padding-top: clamp(1rem,3.5vh,3rem);
    position: relative;
    z-index: 5;
  }
  .hero-copy h1 {
    margin: 1rem 0 1.3rem;
    color: var(--iw-taupe-800);
    font-size: var(--font-size-display);
    font-weight: 320;
    letter-spacing: var(--tracking-display);
    line-height: var(--line-tight);
  }
  .hero-copy h1 em,
  .section-head h2 em {
    color: var(--color-accent);
    font-style: normal;
  }
  .hero-copy__lead {
    max-width: 35rem;
    margin: 0;
    color: var(--color-muted);
    font-size: var(--font-size-xl);
  }
  .hero-values {
    margin-top: 2.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .9rem 1.1rem;
  }
  .hero-values span {
    padding-right: 1.1rem;
    border-right: 1px solid var(--color-line);
    color: var(--iw-taupe-700);
    font-size: .82rem;
  }

  .oracle-stage {
    min-height: 31rem;
    position: relative;
    z-index: 8;
  }
  .source {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%,-50%);
  }

  .prompt-card { position: absolute; z-index: 4; }
  .prompt-card--1 { left: 1%; top: 2%; }
  .prompt-card--2 { right: 0; top: 8%; }
  .prompt-card--3 { left: 0; top: 35%; }
  .prompt-card--4 { right: -1%; top: 38%; }
  .prompt-card--5 { left: 3%; bottom: 4%; }
  .prompt-card--6 { right: 1%; bottom: 5%; }

  .oracle-flow {
    align-self: start;
    position: relative;
    z-index: 10;
  }

  .question-shell {
    grid-column: 2 / 3;
    position: relative;
    z-index: 12;
    align-self: end;
    margin-top: -1.1rem;
  }
  .question-hint {
    margin: .55rem auto 0;
    color: var(--color-subtle);
    font-size: .72rem;
    text-align: center;
  }

  .prototype-status {
    grid-column: 2 / 3;
    justify-self: center;
    min-height: 2rem;
  }

  .perspective-page {
    min-height: calc(100vh - var(--header-height));
    position: relative;
    overflow: clip;
    border-top: 1px solid rgba(117,102,94,.08);
    background:
      radial-gradient(circle at 78% 14%, rgba(255,146,68,.13), transparent 24rem),
      linear-gradient(180deg,#fffaf6 0%,#fffdfb 55%,#faf6f2 100%);
  }
  .perspective-page[hidden] { display: none; }
  .perspective-page.is-entering { animation: page-enter .75s var(--ease-out) both; }
  .perspective-page__glow {
    width: 38rem;
    height: 38rem;
    position: absolute;
    right: -9rem;
    top: -15rem;
    border: 1px solid rgba(255,122,34,.16);
    border-radius: 50%;
    box-shadow:
      inset 0 0 7rem rgba(255,157,80,.08),
      0 0 8rem rgba(255,122,34,.05);
  }
  .perspective-page__glow::before,
  .perspective-page__glow::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255,122,34,.12);
    border-radius: 50%;
  }
  .perspective-page__glow::before { inset: 12% -8%; transform: rotate(23deg); }
  .perspective-page__glow::after { inset: -8% 18%; transform: rotate(-31deg); }

  .perspective-page__shell {
    width: min(100%, var(--page-max));
    margin: 0 auto;
    padding: clamp(3rem,6vw,6rem) var(--page-pad);
    position: relative;
    z-index: 2;
  }
  .perspective-page__top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 2rem;
  }
  .perspective-page__kicker {
    margin: .55rem 0 0;
    color: var(--color-subtle);
    font-size: .82rem;
  }
  .perspective-page__intro {
    margin-top: clamp(2rem,5vw,4.5rem);
    display: grid;
    grid-template-columns: minmax(0,1.5fr) minmax(18rem,.7fr);
    gap: clamp(2rem,5vw,5rem);
    align-items: end;
  }
  .perspective-page__intro h2 {
    max-width: 58rem;
    margin: 0 0 1rem;
    color: var(--iw-taupe-800);
    font-size: clamp(2.8rem,5vw,5.8rem);
    font-weight: 330;
    letter-spacing: -.052em;
    line-height: 1.02;
  }
  .perspective-page__intro p {
    max-width: 50rem;
    margin: 0;
    color: var(--color-muted);
    font-size: 1.08rem;
  }
  .perspective-page blockquote {
    margin: 0;
    padding: 1.25rem 1.4rem;
    border-left: .18rem solid var(--color-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--iw-taupe-700);
    background: rgba(255,255,255,.64);
    font-size: .96rem;
  }

  .result-path {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: .7rem;
  }
  .result-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: .8rem;
  }
  .evidence-note {
    margin-top: 1rem;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }
  .evidence-note b { display: block; color: var(--iw-taupe-800); }
  .evidence-note p {
    margin: .25rem 0 0;
    color: var(--color-muted);
    font-size: .84rem;
  }

  .section {
    width: min(100%, var(--page-max));
    margin: 0 auto;
    padding: clamp(2.5rem,5vw,4.5rem) var(--page-pad);
    border-top: 1px solid rgba(117,102,94,.08);
  }
  .section--soft {
    max-width: none;
    background: rgba(247,242,238,.64);
  }
  .section--soft > * {
    width: min(100%, calc(var(--page-max) - (2 * var(--page-pad))));
    margin-inline: auto;
  }

  .section-head {
    margin-bottom: 1.4rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
  }
  .section-head h2 {
    margin: .25rem 0 0;
    color: var(--iw-taupe-800);
    font-size: var(--font-size-2xl);
    font-weight: 380;
    letter-spacing: -.035em;
    line-height: 1.08;
  }
  .section-head > p {
    max-width: 39rem;
    margin: 0;
    color: var(--color-muted);
  }

  .solution-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .8rem;
  }
  .competence-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .75rem;
  }

  .generated-context {
    margin: 0 0 1.15rem;
    padding: 1rem 1.2rem;
    border-left: .18rem solid var(--color-accent);
    color: var(--color-muted);
    background: rgba(255,255,255,.55);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }
  .generated-context[hidden] { display: none; }
  .generated-context strong { color: var(--iw-taupe-800); }

  .site-footer {
    padding: 2.1rem var(--page-pad);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    color: var(--color-subtle);
    border-top: 1px solid var(--color-line);
    font-size: .78rem;
  }

  @keyframes page-enter {
    from { opacity: 0; transform: translateY(1.2rem); }
    to { opacity: 1; transform: translateY(0); }
  }



  @media (max-width: 1180px) {
    .nav-links { display: none; }
    .menu-button { display: block; }
    .hero {
      grid-template-columns: minmax(18rem,.9fr) minmax(28rem,1.2fr);
      grid-template-rows: auto auto auto auto;
    }
    .oracle-flow { grid-column: 1 / 3; }
    .question-shell, .prototype-status { grid-column: 1 / 3; }
    .solution-grid { grid-template-columns: repeat(2,1fr); }
    .competence-grid { grid-template-columns: repeat(3,1fr); }
    .mobile-nav:not([hidden]) { display: block; }
    .result-grid { grid-template-columns: repeat(2,1fr); }
  }

  @media (max-width: 760px) {
    :root {
      --header-height: 4.75rem;
      --page-pad: 1rem;
      --source-size: clamp(10.8rem, 44vw, 12.8rem);
    }

    body {
      overflow-x: hidden;
      background:
        radial-gradient(circle at 58% 19%, rgba(255,151,72,.09), transparent 19rem),
        linear-gradient(180deg, var(--color-bg), var(--color-bg-soft));
    }

    .site-header {
      gap: .65rem;
      padding-left: max(var(--page-pad), env(safe-area-inset-left));
      padding-right: max(var(--page-pad), env(safe-area-inset-right));
    }
    .brand { min-width: 0; }
    .brand-logo-legacy {
      width: clamp(10rem, 47vw, 12.25rem);
      max-height: 3.45rem;
      object-fit: contain;
      object-position: left center;
    }
    .menu-button {
      width: 2.75rem;
      height: 2.75rem;
      flex: 0 0 auto;
      touch-action: manipulation;
    }

    .mobile-nav {
      inset: var(--header-height) 0 0;
      padding:
        1.35rem max(var(--page-pad), env(safe-area-inset-right))
        calc(2rem + env(safe-area-inset-bottom))
        max(var(--page-pad), env(safe-area-inset-left));
      overflow-y: auto;
      background:
        radial-gradient(circle at 85% 12%, rgba(255,122,34,.12), transparent 15rem),
        rgba(255,253,251,.985);
    }
    .mobile-nav a {
      padding: 1rem .15rem;
      font-size: 1.05rem;
    }

    .hero {
      min-height: 0;
      padding-top: 1.8rem;
      padding-bottom: 2.5rem;
      display: block;
    }
    .hero::before,
    .hero::after {
      width: 37rem;
      height: 15rem;
      left: -48%;
      top: 22rem;
    }
    .hero-copy { padding: 0; }
    .hero-copy h1 {
      max-width: 9ch;
      margin-top: .75rem;
      font-size: clamp(3rem, 14vw, 4.35rem);
    }
    .hero-copy__lead {
      max-width: 31rem;
      font-size: 1.02rem;
      line-height: 1.55;
    }

    .hero-values {
      margin: 1.45rem calc(-1 * var(--page-pad)) 0 0;
      padding: 0 var(--page-pad) .35rem 0;
      flex-wrap: nowrap;
      gap: .55rem;
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      scroll-snap-type: x proximity;
      scrollbar-width: none;
    }
    .hero-values::-webkit-scrollbar { display: none; }
    .hero-values span {
      flex: 0 0 auto;
      min-height: 2.15rem;
      padding: .52rem .75rem;
      border: 1px solid var(--color-line);
      border-radius: var(--radius-pill);
      background: rgba(255,255,255,.74);
      scroll-snap-align: start;
      white-space: nowrap;
    }

    .oracle-stage {
      height: 31.5rem;
      margin: .75rem -.15rem .25rem;
    }
    .source { top: 49%; }
    .prompt-card {
      width: auto;
      max-width: min(10.3rem, 47%);
      min-height: 3.15rem;
      padding: .62rem .7rem;
      gap: .45rem;
      border-radius: .85rem;
      font-size: .69rem;
      cursor: pointer;
      touch-action: manipulation;
      animation: none;
    }
    .prompt-card__icon { font-size: .95rem; }
    .prompt-card--1 { left: 0; top: 2%; }
    .prompt-card--2 { right: 0; top: 4%; }
    .prompt-card--3 { left: 0; top: 32%; }
    .prompt-card--4 { right: 0; top: 34%; }
    .prompt-card--5 { left: 0; bottom: 3%; }
    .prompt-card--6 { right: 0; bottom: 2%; }

    .oracle-flow {
      margin-top: .75rem;
      padding: 1rem;
      overflow: hidden;
    }
    .oracle-flow__title {
      margin-bottom: .8rem;
      font-size: 1.08rem;
    }
    .oracle-flow ol {
      display: flex;
      gap: .65rem;
      overflow-x: auto;
      padding-bottom: .15rem;
      scroll-snap-type: x mandatory;
      overscroll-behavior-inline: contain;
      scrollbar-width: none;
    }
    .oracle-flow ol::-webkit-scrollbar { display: none; }
    .oracle-flow li {
      min-height: 7.15rem;
      flex: 0 0 82%;
      padding: 2.75rem .9rem .9rem;
      border: 1px solid rgba(117,102,94,.12);
      border-radius: var(--radius-sm);
      background: rgba(255,255,255,.58);
      scroll-snap-align: start;
      transform: none;
    }
    .oracle-flow li::before {
      left: .9rem;
      top: .7rem;
    }
    .oracle-flow li::after { display: none; }
    .oracle-flow li.is-active {
      border-color: rgba(255,122,34,.48);
      background: #fffaf6;
      transform: none;
    }
    .oracle-flow small { font-size: .75rem; }

    .question-shell {
      margin: 1rem 0 0;
      position: sticky;
      bottom: max(.65rem, env(safe-area-inset-bottom));
      z-index: 20;
    }
    .question-form {
      padding: .5rem;
      border-radius: 1.15rem;
      grid-template-columns: 1fr;
      gap: .45rem;
      box-shadow: 0 16px 42px rgba(91,67,52,.12);
    }
    .question-form input {
      min-height: 3.1rem;
      padding: .25rem .8rem;
    }
    .question-form .iw-button {
      width: 100%;
      min-height: 3rem;
      justify-content: center;
      touch-action: manipulation;
    }
    .question-hint {
      max-width: 22rem;
      margin-top: .7rem;
      font-size: .68rem;
    }
    .prototype-status { margin: .75rem auto 0; }

    .perspective-page__shell {
      padding-top: 2.1rem;
      padding-bottom: 2.6rem;
    }
    .perspective-page__glow {
      width: 24rem;
      height: 24rem;
      right: -11rem;
      top: -9rem;
    }
    .perspective-page__top,
    .perspective-page__intro { display: block; }
    .perspective-page__top .iw-button {
      width: 100%;
      margin-top: 1rem;
      justify-content: center;
    }
    .perspective-page__intro { margin-top: 2.2rem; }
    .perspective-page__intro blockquote { margin-top: 1.35rem; }
    .perspective-page__intro h2 {
      max-width: 11ch;
      font-size: clamp(2.5rem, 12.5vw, 4rem);
    }
    .result-path,
    .result-grid { grid-template-columns: 1fr; }
    .result-path { gap: .55rem; }
    .result-grid { margin-top: .7rem; gap: .65rem; }
    .evidence-note { padding: 1rem; }
    .page-plan-debug { font-size: .78rem; }

    .section {
      padding-top: 2.75rem;
      padding-bottom: 2.75rem;
    }
    .section-head { display: block; }
    .section-head > p { margin-top: .9rem; }
    .solution-grid,
    .competence-grid {
      grid-template-columns: 1fr;
      gap: .65rem;
    }
    .solution-card,
    .competence-card { min-height: 5.35rem; }
    .site-footer {
      padding-bottom: calc(2rem + env(safe-area-inset-bottom));
      flex-direction: column;
      gap: .45rem;
    }
  }

  @media (max-width: 430px) {
    :root {
      --page-pad: .9rem;
      --source-size: 10.6rem;
    }
    .brand-logo-legacy { width: 9.8rem; }
    .hero-copy h1 { font-size: clamp(2.8rem, 14.5vw, 3.8rem); }
    .oracle-stage {
      height: 30rem;
      margin-inline: -.25rem;
    }
    .prompt-card {
      max-width: 46.5%;
      min-height: 3rem;
      padding: .58rem .62rem;
      font-size: .65rem;
    }
    .prompt-card__icon { display: none; }
    .oracle-flow li { flex-basis: 88%; }
    .perspective-page__intro h2 { font-size: clamp(2.35rem, 12.8vw, 3.5rem); }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .perspective-page.is-entering { animation: none; }
  }

/* Mobile-first stabilization — conventional Material/Bootstrap-style behavior */
@media (max-width: 1180px) {
  .nav-links { display: none; }
  .menu-button { display: block; flex: 0 0 auto; }
  .mobile-nav:not([hidden]) { display: block; }
}

@media (max-width: 760px) {
  .site-header {
    min-height: var(--header-height);
    overflow: hidden;
  }

  .brand--legacy {
    flex: 1 1 auto;
    max-width: calc(100% - 4rem);
    overflow: hidden;
  }

  .brand-logo-legacy {
    max-width: 12rem;
    width: min(47vw, 12rem);
    height: auto;
  }

  .mobile-nav {
    width: 100%;
    max-width: 100vw;
  }

  .hero {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .oracle-stage {
    width: 100%;
    max-width: 100%;
    height: 34rem;
    margin-inline: 0;
    overflow: visible;
  }

  .source {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%,-50%);
    z-index: 3;
    touch-action: manipulation;
  }

  .source.is-drop-target {
    transform: translate(-50%,-50%) scale(1.055);
  }

  .prompt-card {
    position: absolute;
    z-index: 6;
    width: calc(50% - .4rem);
    max-width: none;
    min-height: 3.25rem;
    margin: 0;
    justify-content: flex-start;
    cursor: pointer;
    touch-action: manipulation;
  }

  .prompt-card--1 { left: 0; top: 0; }
  .prompt-card--2 { right: 0; top: 0; }
  .prompt-card--3 { left: 0; top: 20%; }
  .prompt-card--4 { right: 0; top: 20%; }
  .prompt-card--5 { left: 0; bottom: 0; }
  .prompt-card--6 { right: 0; bottom: 0; }

  .prompt-card[aria-pressed="true"] {
    transform: none;
  }

  .question-shell {
    position: relative;
    bottom: auto;
    margin-top: 1.15rem;
  }

  .question-form input,
  .question-form .iw-button,
  .menu-button,
  .mobile-nav a,
  .prompt-card {
    min-height: 3rem;
  }

  .question-form input {
    font-size: 1rem;
  }

  .iw-button {
    min-height: 3rem;
  }

  .oracle-flow {
    margin-top: 1rem;
  }

  .oracle-flow li {
    flex-basis: 86%;
  }
}

@media (max-width: 430px) {
  .oracle-stage { height: 32.5rem; }
  .prompt-card {
    width: calc(50% - .3rem);
    padding-inline: .62rem;
    font-size: .66rem;
  }
  .prompt-card--3,
  .prompt-card--4 { top: 19%; }
  .source { top: 57%; }
}



/* Touch drag for Oracle prompt cards */
.touch-drag-ghost {
  position: fixed;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: .96;
  box-shadow: 0 22px 58px rgba(91,67,52,.18), 0 0 0 2px rgba(255,122,34,.16);
}

.prompt-card.touch-dragging {
  opacity: .28;
  transform: scale(.98);
}

@media (max-width: 760px), (pointer: coarse) {
  .prompt-card {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .source {
    touch-action: manipulation;
  }

  .source.is-drop-target {
    filter: brightness(1.18);
    box-shadow:
      0 0 0 .28rem rgba(255,255,255,.94),
      0 0 0 .52rem rgba(255,122,34,.42),
      0 0 7rem rgba(255,122,34,.34),
      inset 0 0 3rem rgba(255,255,255,.92);
  }
}
