/* tasteskill v2 — Direction: Photographs at uneven sizes (seed 1025186657)
   Type: Work Sans (300, 400, 500) · Palette: Putty and black */

:root {
  --bg: #dedad3;
  --surface: #d3cec6;
  --ink: #0a0a0a;
  --muted: #4a4640;
  --accent: #256f82;
  --accent-strong: #1b5666;
  --accent-ink: #ffffff;

  --dark-bg: #111110;
  --dark-surface: #1d1c1a;
  --dark-ink: #dedad3;
  --dark-muted: #aba59c;

  --font-display: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Work Sans", "Helvetica Neue", Arial, sans-serif;

  /* Strictly 5 font-size steps */
  --step-small: 0.875rem;                                    /* 14px */
  --step-body: 1.0625rem;                                    /* 17px */
  --step-lead: 1.25rem;                                      /* 20px */
  --step-head: clamp(1.75rem, 1.25rem + 1.8vw, 2.75rem);     /* 28–44px */
  --step-display: clamp(2.2rem, 1.05rem + 3.6vw, 4.25rem);   /* 35.2–68px */

  --margin: clamp(1.25rem, 5.5vw, 5rem);
  --gutter: clamp(1rem, 1.8vw, 1.75rem);

  /* Motion tokens from references/motion.md */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-exit: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --t-press: 140ms;
  --t-hover: 200ms;
  --t-ui: 280ms;
  --t-reveal: 820ms;
  --t-open: 1100ms;
  --stagger-line: 90ms;
  --stagger-item: 75ms;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Frame & 12-Column Grid */
.wrap {
  padding-inline: var(--margin);
  width: 100%;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.col-1-5 { grid-column: 1 / 6; }
.col-1-6 { grid-column: 1 / 7; }
.col-1-7 { grid-column: 1 / 8; }
.col-1-8 { grid-column: 1 / 9; }
.col-1-4 { grid-column: 1 / 5; }
.col-5-8 { grid-column: 5 / 9; }
.col-5-12 { grid-column: 5 / 13; }
.col-6-12 { grid-column: 6 / 13; }
.col-7-12 { grid-column: 7 / 13; }
.col-8-12 { grid-column: 8 / 13; }
.col-9-12 { grid-column: 9 / 13; }
.col-6-9 { grid-column: 6 / 10; }
.col-1-12 { grid-column: 1 / 13; }

/* Sections & Surfaces (separated by flat tone steps and space, zero 1px lines) */
.section {
  padding-block: clamp(4.5rem, 8.5vw, 7.5rem);
}

.section-surface {
  background-color: var(--surface);
  color: var(--ink);
}

.section-dark {
  background-color: var(--dark-bg);
  color: var(--dark-ink);
}

.panel {
  background-color: var(--surface);
  padding: clamp(1.5rem, 2.8vw, 2.5rem);
}

.section-surface .panel {
  background-color: var(--bg);
}

.section-dark .panel {
  background-color: var(--dark-surface);
  color: var(--dark-ink);
}

/* Typography — Strictly 5 steps, headlines <= 2 lines */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  color: inherit;
  margin: 0;
  hyphens: none;
  text-wrap: balance;
}

.display {
  font-size: var(--step-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 300;
  margin-left: -0.04em;
}

.head {
  font-size: var(--step-head);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 300;
}

.subhead {
  font-size: var(--step-lead);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 400;
}

p {
  margin: 0;
  max-width: 58ch;
  text-wrap: pretty;
  font-size: var(--step-body);
}

p + p {
  margin-top: 0.9em;
}

.lead {
  font-size: var(--step-lead);
  line-height: 1.4;
  max-width: 44ch;
  font-weight: 400;
}

.muted {
  color: var(--muted);
}

.section-dark .muted {
  color: var(--dark-muted);
}

.small, small, figcaption {
  font-size: var(--step-small);
  line-height: 1.45;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Plain Navigation Bar (No fixed overlap, no glass, no border) */
.site-header {
  padding-inline: var(--margin);
  padding-block: 1.5rem;
  background-color: var(--bg);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-body);
  font-weight: 500;
  line-height: 1.2;
}

.wordmark span {
  display: block;
  font-size: var(--step-small);
  font-weight: 400;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.24em;
  text-decoration-thickness: 0.08em;
  font-size: var(--step-body);
  white-space: nowrap;
  transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease;
}

.nav-link.is-active {
  text-decoration-color: var(--ink);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons & Links (Square corners per direction sheet, flat colour, tactile press/hover) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  background-color: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-surface {
  background-color: var(--surface);
  color: var(--ink);
}

.section-surface .btn-surface {
  background-color: var(--bg);
}

.section-dark .btn-surface {
  background-color: var(--dark-surface);
  color: var(--dark-ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  font-size: var(--step-body);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.08em;
  transition: color var(--t-hover) ease, transform var(--t-ui) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background-color: var(--accent-strong);
  }
  .btn-surface:hover {
    background-color: var(--ink);
    color: var(--bg);
  }
  .nav-link:hover {
    text-decoration-color: currentColor;
  }
  .text-link:hover {
    color: var(--accent);
    transform: translateX(4px);
  }
}

/* Mobile Menu Toggle & Sheet */
.mobile-toggle {
  display: none;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background-color: var(--surface);
  color: var(--ink);
  border: 0;
  font-family: var(--font-text);
  font-size: var(--step-body);
  font-weight: 500;
  cursor: pointer;
}

.mobile-sheet {
  display: none;
  background-color: var(--surface);
  padding-inline: var(--margin);
  padding-block: 1.5rem;
}

.mobile-sheet.is-open {
  display: block;
}

.mobile-sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Blueprint 1: Uneven Gallery Hero */
.hero-gallery {
  padding-top: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
}

.hero-stage {
  position: relative;
  overflow: clip;
  background-color: var(--surface);
  aspect-ratio: 16 / 10;
}

.hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1400ms var(--ease-in-out), transform 1600ms var(--ease-soft);
}

.hero-stage img.crossfade-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.hero-stage img.crossfade-layer.is-active {
  opacity: 1;
}

.photo-frame {
  overflow: clip;
  background-color: var(--surface);
  margin: 0;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-soft);
}

@media (hover: hover) and (pointer: fine) {
  .photo-frame:hover img {
    transform: scale(1.04);
  }
}

/* Blueprint 2: Showcase — Band of Unequal Panels (flex-grow 5, 2, 3, 2) */
.unequal-band {
  display: flex;
  width: 100%;
  height: 66svh;
  min-height: 440px;
  max-height: 680px;
  overflow: clip;
}

.unequal-slice {
  position: relative;
  overflow: clip;
  text-decoration: none;
  color: var(--accent-ink);
  transition: flex-grow 520ms var(--ease-out);
}

.unequal-slice:nth-child(1) { flex: 5 1 0%; }
.unequal-slice:nth-child(2) { flex: 2 1 0%; }
.unequal-slice:nth-child(3) { flex: 3 1 0%; }
.unequal-slice:nth-child(4) { flex: 2 1 0%; }

@media (hover: hover) and (pointer: fine) {
  .unequal-band:hover .unequal-slice {
    flex-grow: 2;
  }
  .unequal-band .unequal-slice:hover {
    flex-grow: 6;
  }
}

.unequal-slice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-soft);
}

.slice-caption {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background-color: rgba(10, 10, 10, 0.78);
  color: #ffffff;
  padding: 0.75rem 1rem;
  max-width: 24ch;
}

/* Blueprint 3: How-it-works — Photographs down a diagonal */
.diagonal-stage-2 {
  margin-top: 6rem;
}

.diagonal-stage-3 {
  margin-top: 4rem;
}

/* Blueprint 4: Proof — Plain names & clinical credentials in columns */
.columns-list {
  columns: 3;
  column-gap: 2.5rem;
}

.columns-list p {
  margin: 0 0 0.75rem 0;
  break-inside: avoid;
}

/* Blueprint 5: FAQ — Questions beside a tall photograph (no lines, 28px gap) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.faq-item {
  background-color: var(--bg);
  padding: 1.5rem 1.75rem;
}

.section-dark .faq-item {
  background-color: var(--dark-surface);
}

.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-family: var(--font-text);
  font-size: var(--step-lead);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 360ms var(--ease-out);
}

.faq-body > div {
  overflow: hidden;
}

/* Interactive Clinical Workbench (Before/After + Recovery Timeline) */
.ba-compare {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: clip;
  user-select: none;
  background-color: var(--dark-bg);
}

.ba-compare img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-before-layer {
  position: absolute;
  inset: 0;
  overflow: clip;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--accent-ink);
  pointer-events: none;
}

.ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-color: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tab-btn {
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  background-color: var(--surface);
  color: var(--ink);
  border: 0;
  font-family: var(--font-text);
  font-size: var(--step-body);
  font-weight: 400;
  cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}

.section-dark .tab-btn {
  background-color: var(--dark-surface);
  color: var(--dark-ink);
}

.tab-btn[aria-selected="true"] {
  background-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

/* Tables & Forms */
table.clinical-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
}

table.clinical-table th,
table.clinical-table td {
  padding: 1.1rem 1.25rem;
  text-align: left;
  font-size: var(--step-body);
  border-bottom: 1px solid rgba(10, 10, 10, 0.12);
}

table.clinical-table th {
  font-weight: 500;
  background-color: var(--ink);
  color: var(--bg);
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background-color: var(--bg);
  color: var(--ink);
  border: 0;
  font-family: var(--font-text);
  font-size: var(--step-body);
}

/* Choreographed Motion Layer (references/motion.md §6) */
.lines .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}

.lines [data-line] {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] {
    transform: translateY(105%);
    animation: load-line 820ms var(--ease-expo) forwards;
    animation-delay: calc(80ms + var(--i, 0) * var(--stagger-line));
  }
  .js [data-load] {
    opacity: 0;
    transform: translateY(16px);
    animation: load-rise 560ms var(--ease-out) forwards;
    animation-delay: var(--d, 260ms);
  }
  .js [data-open] {
    clip-path: inset(0 0 100% 0);
    animation: load-open 980ms var(--ease-in-out) 140ms forwards;
  }
  .js [data-open] img {
    transform: scale(1.07);
    animation: load-settle 1100ms var(--ease-expo) 100ms forwards;
  }
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 720ms var(--ease-expo), transform 860ms var(--ease-expo);
    transition-delay: calc(var(--stagger, 0) * var(--stagger-item));
  }
  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
    animation: reveal-pulse 860ms var(--ease-expo) both;
  }
}

@keyframes load-line { to { transform: none; } }
@keyframes load-rise { to { opacity: 1; transform: none; } }
@keyframes load-open { to { clip-path: inset(0); } }
@keyframes load-settle { to { transform: none; } }
@keyframes reveal-pulse {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints (Tablet 768px & Phone 390px) */
@media (max-width: 960px) {
  .nav-links,
  .header-cta-desktop {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .col-1-5, .col-1-6, .col-1-7, .col-1-8, .col-1-4, .col-5-8,
  .col-5-12, .col-6-12, .col-7-12, .col-8-12, .col-9-12, .col-6-9 {
    grid-column: 1 / 13;
  }
  .diagonal-stage-2,
  .diagonal-stage-3 {
    margin-top: 2rem;
  }
  .columns-list {
    columns: 2;
  }
  .unequal-band {
    display: grid;
    grid-template-columns: 62fr 38fr;
    grid-template-rows: 1fr 1fr;
    height: 76svh;
  }
}

@media (max-width: 600px) {
  .columns-list {
    columns: 1;
  }
  .unequal-band {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 220px);
    height: auto;
    max-height: none;
  }
  .unequal-photo-right {
    width: 100%;
    margin-left: 0;
  }
  .unequal-photo-left {
    width: 100%;
    margin-right: 0;
  }
}
