/* Dr. Shilpa Gupta — "The Studio Door".
   A fixed panel stands like a studio door (plum, monogram, plain words);
   beyond it the page reads as sand-coloured paper. System stacks only —
   this site works offline. Layered cascade. */
@layer base, components;

@layer base {
  :root {
    color-scheme: light;
    --sand: #efe6d8;          /* content paper */
    --ink: #342930;
    --ink-soft: color-mix(in srgb, var(--ink) 64%, transparent);
    --line: color-mix(in srgb, var(--ink) 18%, transparent);
    --plum: #6d4a5c;          /* panel ground + headings */
    --plum-head: var(--plum);
    --panel-bg: var(--plum);
    --panel-ink: #f2e9d9;
    --panel-ink-soft: color-mix(in srgb, var(--panel-ink) 72%, transparent);
    --panel-line: color-mix(in srgb, var(--panel-ink) 28%, transparent);
    --copper: #b0713e;        /* accent */
    --field: #f7f1e6;
    --panel-w: 264px;
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --sand: #221b20;
    --ink: #e9dfd2;
    --plum-head: #d8b3c1;
    --panel-bg: #3d2c36;
    --panel-ink: #eee3d3;
    --copper: #cf9058;
    --field: #2d252a;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --sand: #221b20;
      --ink: #e9dfd2;
      --plum-head: #d8b3c1;
      --panel-bg: #3d2c36;
      --panel-ink: #eee3d3;
      --copper: #cf9058;
      --field: #2d252a;
    }
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  body {
    margin: 0;
    background: var(--sand);
    color: var(--ink);
    font: 16px/1.7 system-ui, "Segoe UI", sans-serif;
  }
  h1, h2, h3 {
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 12px;
    color: var(--plum-head);
  }
  h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
  a { color: var(--copper); }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 2px;
  }
  section { scroll-margin-top: 20px; }
}

@layer components {
  .skip-link {
    position: absolute;
    inset-inline-start: -999px;
    &:focus { inset-inline-start: 12px; inset-block-start: 8px; background: var(--sand); padding: 6px 10px; z-index: 20; }
  }

  /* ---- the door: fixed panel, doorway to the whole page ---- */
  .door-panel {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--panel-w);
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 26px 22px;
    background: var(--panel-bg);
    color: var(--panel-ink);
    overflow-y: auto;
  }
  .panel-identity {
    margin: 0;
    display: grid;
    justify-items: start;
    gap: 7px;
    line-height: 1.35;
  }
  .panel-mark {
    display: grid;
    place-items: center;
    width: 76px;
    aspect-ratio: 1;
    border: 1px dashed var(--panel-line);
    border-radius: 50%;
    font: 700 1.9rem Georgia, serif;
    letter-spacing: 0.06em;
  }
  .panel-name {
    font: 650 1.02rem Georgia, serif;
    letter-spacing: 0.01em;
    margin-block-start: 4px;
  }
  .panel-sub { font-size: 0.78rem; color: var(--panel-ink-soft); }
  .panel-note { font-size: 0.68rem; color: var(--panel-ink-soft); font-style: italic; }

  .panel-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .panel-nav a {
    text-decoration: none;
    color: var(--panel-ink-soft);
    font-size: 0.92rem;
    padding: 7px 10px;
    border-inline-start: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    &:hover { color: var(--panel-ink); }
    &[aria-current="true"] {
      color: var(--panel-ink);
      border-inline-start-color: var(--copper);
    }
  }
  .panel-nav a.panel-step {
    margin-block-start: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    &:hover { border-color: var(--copper); }
    &[aria-current="true"] { border-inline-start-color: var(--panel-line); box-shadow: inset 0 -2px 0 var(--copper); }
  }

  .theme-toggle {
    margin-block-start: auto;
    align-self: start;
    border: 1px solid var(--panel-line);
    background: transparent;
    color: var(--panel-ink);
    border-radius: 8px;
    padding: 7px;
    cursor: pointer;
    & .ic-moon { display: none; }
  }
  [data-theme="dark"] .theme-toggle {
    & .ic-sun { display: none; }
    & .ic-moon { display: block; }
  }

  /* ---- the hall beyond the door: scrolling column ---- */
  .studio-hall {
    margin-inline-start: var(--panel-w);
    padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 56px) 80px;
  }
  .studio-hall > section {
    max-width: 680px;
    padding-block: 38px 10px;
    border-block-start: 1px solid var(--line);
    &:first-of-type { border-block-start: 0; }
  }
  .studio-hall h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 2px;
    background: var(--copper);
    margin-block-start: 10px;
  }

  /* ---- doorway (hero) ---- */
  .doorway { padding-block: 10px 20px; }
  .door-art { width: min(200px, 52%); display: block; margin-block-end: 20px; }
  .art-arch { fill: none; stroke: var(--plum-head); stroke-width: 5; stroke-linecap: round; }
  .art-leaf { fill: none; stroke: var(--plum-head); stroke-width: 4; stroke-linejoin: round; }
  .art-grain { fill: none; stroke: var(--ink); stroke-width: 2; opacity: 0.45; }
  .art-handle { fill: var(--copper); }
  .art-step { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: 0.55; }
  .doorway h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
  .hero-lede { font-size: 1.14rem; margin: 0 0 14px; }
  .hero-copy { max-width: 56ch; margin: 0 0 12px; }
  .hero-note { color: var(--ink-soft); font-size: 0.92rem; }

  /* ---- what EFT is ---- */
  .eft-honest {
    border-inline-start: 3px solid var(--copper);
    padding-inline-start: 14px;
  }
  .calm-points {
    list-style: none;
    counter-reset: points;
    padding: 0;
    margin: 14px 0 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 18px;
    & li {
      counter-increment: points;
      display: flex;
      align-items: baseline;
      gap: 9px;
      &::before {
        content: counter(points, decimal-leading-zero);
        font: 600 0.7rem/1 ui-monospace, Menlo, monospace;
        letter-spacing: 0.08em;
        color: var(--copper);
      }
    }
  }

  /* ---- how a session runs ---- */
  .session-rhythm {
    list-style: none;
    counter-reset: beat;
    padding: 0;
    margin: 16px 0;
    display: grid;
    gap: 14px;
    & li {
      counter-increment: beat;
      position: relative;
      padding-inline-start: 46px;
      &::before {
        content: counter(beat, decimal-leading-zero);
        position: absolute;
        inset-inline-start: 0;
        inset-block-start: 0;
        font: 600 0.95rem/1.7 Georgia, serif;
        color: var(--copper);
      }
      & strong { display: block; font-weight: 650; }
    }
  }
  .sessions-note { color: var(--ink-soft); font-size: 0.9rem; }

  /* ---- who the studio is for ---- */
  .people-list {
    margin: 16px 0 0;
    display: grid;
    gap: 16px;
    & > div {
      border-block-start: 1px solid var(--line);
      padding-block-start: 12px;
    }
    & dt { font: 600 1.05rem Georgia, serif; color: var(--plum-head); }
    & dd { margin: 4px 0 0; color: var(--ink-soft); max-width: 58ch; }
  }

  /* ---- the studio ---- */
  .studio-address {
    font-style: normal;
    display: grid;
    gap: 2px;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--sand) 92%, var(--plum) 8%);
    & .studio-org { font: 650 1rem Georgia, serif; color: var(--plum-head); }
  }
  .studio-lines {
    margin: 0;
    display: grid;
    gap: 8px;
    & > div { display: flex; gap: 14px; align-items: baseline; }
    & dt {
      flex: 0 0 62px;
      font: 600 0.7rem/1.9 ui-monospace, Menlo, monospace;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--copper);
    }
    & dd { margin: 0; }
  }

  /* ---- the practitioner ---- */
  .practitioner-sources { font-size: 0.88rem; color: var(--ink-soft); max-width: 58ch; }

  /* ---- step in (booking) ---- */
  .booking-form {
    display: grid;
    gap: 8px;
    max-width: 480px;
  }
  .booking-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-block-start: 8px;
  }
  .booking-optional { font-weight: 400; color: var(--ink-soft); }
  .booking-field {
    font: inherit;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: inherit;
  }
  .booking-field.invalid { border-color: var(--copper); }
  .booking-error { min-height: 1.2em; font-size: 0.88rem; color: var(--copper); }
  .booking-submit {
    justify-self: start;
    font: inherit;
    font-weight: 650;
    padding: 11px 24px;
    border-radius: 999px;
    border: 0;
    background: var(--copper);
    color: var(--sand);
    cursor: pointer;
    &:hover { filter: brightness(1.07); }
  }
  .booking-fallback { font-size: 0.9rem; color: var(--ink-soft); }

  /* ---- footer ---- */
  .studio-foot {
    margin-inline-start: var(--panel-w);
    border-block-start: 1px solid var(--line);
    padding: 24px clamp(18px, 5vw, 56px) 44px;
  }
  .foot-rule { margin: 0 0 6px; font-size: 0.9rem; }
  .foot-note { margin: 0; font-size: 0.8rem; color: var(--ink-soft); max-width: 60ch; }

  /* ---- below the doorway width, the panel becomes a plain header ---- */
  @media (max-width: 860px) {
    .door-panel {
      position: static;
      width: auto;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px 16px;
      padding: 14px 18px;
      overflow-y: visible;
    }
    .panel-identity {
      grid-template-columns: 48px 1fr;
      flex: 1 1 300px;
      min-width: 0;
      gap: 1px 12px;
      & .panel-mark { width: 48px; grid-row: span 3; font-size: 1.15rem; }
      & .panel-name { margin-block-start: 0; font-size: 0.98rem; }
      & .panel-sub, & .panel-note { font-size: 0.7rem; }
    }
    .panel-nav {
      order: 3;
      flex-basis: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 2px 4px;
      overflow-x: auto;
      scrollbar-width: none;
      &::-webkit-scrollbar { display: none; }
      & a {
        padding: 6px 9px;
        border-inline-start: 0;
        white-space: nowrap;
        &[aria-current="true"] {
          border-inline-start: 0;
          box-shadow: inset 0 -2px 0 var(--copper);
        }
      }
      & a.panel-step { margin-block-start: 0; }
    }
    .theme-toggle { margin-block-start: 0; margin-inline-start: auto; }
    .studio-hall {
      margin-inline-start: 0;
      padding: 10px 18px 60px;
    }
    .studio-foot { margin-inline-start: 0; }
    section { scroll-margin-top: 12px; }
  }
}
