/* Thanya Sivasubramaniam portfolio: shared styles
   Single, deliberate light look: every colour below is set explicitly. */

:root {
  --bg: #fbfbf8;
  --ink: #141414;
  --muted: #5f5d5a;
  /* Colours taken from the pink flowers and green leaves in Thanya's reference image.
     Text colours (--accent, --leaf) pass WCAG AA on --bg; the tints are decoration only. */
  --accent: #a63a63;      /* berry pink: active nav, links (5.9:1 on bg) */
  --leaf: #4f6b21;        /* leaf green: hover, small labels (5.9:1 on bg) */
  --pink-soft: #e8a9bd;
  --green-soft: #a9cd7a;
  --on-accent: #ffffff;
  --todo-ink: #3f5a1a;
  --todo-bg: #e6efd3;
  --side: 380px;
  --top: 80px;
  --gap: 40px;
  --edge: 36px;
  --gl: max(20px, env(safe-area-inset-left, 0px));
  --gr: max(20px, env(safe-area-inset-right, 0px));
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Mrs Saint Delafield", "Brush Script MT", cursive;
  /* placeholder tints: removed once real images are in */
  --ph-a: #f3dfe5;
  --ph-b: #e1ecd0;
  --ph-c: #f4ecdc;
  --ph-d: #eadfd3;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: #f1d3dd; color: var(--ink); }

/* Soft pink-to-green strip down the left edge (decorative) */
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; left: 0; width: 6px; z-index: 5;
  background: linear-gradient(to bottom, var(--pink-soft), #f4efe4 52%, var(--green-soft));
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
}
.skip:focus { left: 8px; }

/* ---------- Sidebar ---------- */
.side {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--side);
  padding: calc(var(--top) + 50px) 24px 32px 66px;
  display: flex; flex-direction: column;
}
.logo {
  display: block; text-decoration: none; margin-bottom: 52px;
  font-family: var(--script); font-size: 2.7rem; line-height: .9; color: var(--ink);
  white-space: nowrap;
}
.logo span { display: block; }
.logo:hover { color: var(--accent); }

.side nav ul { list-style: none; margin: 0; padding: 0; }
.side nav a { display: block; padding: 11px 0; text-decoration: none; font-size: 1.05rem; color: var(--ink); }
.side nav a:hover { color: var(--leaf); }
.side nav a[aria-current="page"] { color: var(--accent); }

.copy { margin: auto 0 0; font-size: .8rem; color: var(--ink); max-width: 260px; }

/* ---------- Main ---------- */
main { margin-left: calc(var(--side) + var(--edge)); padding-top: var(--top); position: relative; }

/* Home: sideways-scrolling image banner */
.strip {
  display: flex; gap: var(--gap);
  height: calc(100vh - var(--top) - 70px);
  min-height: 420px;
  overflow-x: auto; overflow-y: hidden;
  padding-right: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: #bdb8b0 transparent;
}
.slide { flex: 0 0 auto; height: 100%; margin: 0; aspect-ratio: var(--ar, 3 / 4); }
.slide a { display: block; height: 100%; }
.slide .ph { min-width: 280px; }
.slide img { height: 100%; width: auto; max-width: none; display: block; }

/* ---------- Placeholders and images ---------- */
.frame { aspect-ratio: var(--ar, 4 / 5); background: var(--ph-c); overflow: hidden; max-width: 100%; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.frame-link { display: block; text-decoration: none; }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--muted); font-size: .85rem; letter-spacing: .02em;
  background: var(--ph-a);
}
.ph.b { background: var(--ph-b); }
.ph.c { background: var(--ph-c); }
.ph.d { background: var(--ph-d); }

/* ---------- Inner pages ---------- */
.page { max-width: 1120px; padding: 0 var(--edge) 96px 0; }
.page h1 {
  font-weight: 500; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1;
  margin: 0 0 48px; text-wrap: balance;
}
.page h1::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: 18px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink-soft), var(--green-soft));
}
.page h2 { font-weight: 500; font-size: 1.5rem; line-height: 1.2; margin: 0 0 28px; text-wrap: balance; }
.page section { padding-top: 24px; margin-bottom: 72px; }
.page section + section { border-top: 1px solid #e3e0d8; padding-top: 56px; }

.rows {
  display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr);
  gap: 26px 48px; margin: 0 0 48px; max-width: 900px;
}
.rows dt { font-weight: 700; font-size: 1rem; padding-top: 3px; }
.rows dd { margin: 0; }
.rows dd p { margin: 0 0 16px; }
.rows a { color: var(--accent); text-underline-offset: 4px; }
.rows a:hover { color: var(--leaf); }

.gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.gal figure { margin: 0; }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: 10px; }

/* Resource cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 48px 28px; align-items: start; }
.cards figure { margin: 0; min-width: 0; }
.cap { margin-top: 12px; }
.cap strong { display: block; font-weight: 500; line-height: 1.3; }
.cap span { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.res-links { margin: 8px 0 0; font-size: .9rem; }
.res-links a { color: var(--accent); text-underline-offset: 4px; }
.res-links a:hover { color: var(--leaf); }
.hint { color: var(--muted); font-size: .95rem; margin: 0 0 20px; max-width: 640px; }

/* Before / after comparison */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; align-items: start; margin-bottom: 28px; }
.compare figure { margin: 0; min-width: 0; }
.notes { margin: 0 0 20px; padding-left: 1.1em; max-width: 760px; }
.notes li { margin-bottom: 8px; }

/* Side-by-side page sets (before / after) */
.pageset { display: grid; gap: 36px; margin-bottom: 12px; }
.pagerow h3 { font-size: .95rem; font-weight: 700; margin: 0 0 12px; }
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pages li { min-width: 0; }
.zoom { display: block; aspect-ratio: var(--ar); background: var(--ph-c); box-shadow: 0 0 0 1px #e3e0d8; cursor: zoom-in; }
.zoom img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pg { display: block; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.lightbox { border: 0; padding: 0; background: var(--bg); max-width: min(94vw, 1500px); max-height: 94vh; overflow: auto; }
.lightbox::backdrop { background: rgba(20, 20, 20, .72); }
.lightbox img { display: block; max-width: 100%; max-height: 82vh; width: auto; height: auto; margin: 0 auto; }
.lightbox p { margin: 0; padding: 10px 16px; font-size: .9rem; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.masonry .zoom { box-shadow: none; }
.lb-nav { display: flex; gap: 8px; }
.lightbox button { font: inherit; padding: 6px 16px; border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gal3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.gal3 figure { margin: 0; }
.gal3 .w2 { grid-column: span 2; }

.masonry { columns: 3; column-gap: var(--gap); }
.masonry figure { margin: 0 0 var(--gap); break-inside: avoid; }
.strip { overscroll-behavior-x: contain; }
.strip-nav { position: absolute; top: 22px; right: var(--edge); z-index: 6; display: flex; gap: 8px; }
.strip-nav button { background: var(--bg) !important; font: inherit; font-size: 1.1rem; line-height: 1; width: 44px; height: 36px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.strip-nav button:hover:not(:disabled) { border-color: var(--leaf); color: var(--leaf); }
.strip-nav button:disabled { opacity: .35; cursor: default; }

/* Illustration page */
.feature { margin-bottom: 64px; }
.feature figure { margin: 0; }
.feature .cards { grid-template-columns: minmax(0, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.split figure { margin: 0; }
.split .rows { grid-template-columns: 1fr; gap: 6px; }
.split .rows dd { margin-bottom: 22px; }

/* English / French switch (shown only on resources that have both) */
.lang-toggle { display: flex; gap: 8px; margin: 14px 0 4px; }
.lang-toggle button {
  font: inherit; font-size: .8rem; font-weight: 500; letter-spacing: .08em;
  padding: 6px 16px; border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.lang-toggle button:hover:not([aria-pressed="true"]) { border-color: var(--leaf); color: var(--leaf); }
.lang-toggle button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.res-panel[hidden] { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Content still to be written by Thanya */
.todo { color: var(--todo-ink); background: var(--todo-bg); padding: 0 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  :root { --top: 28px; --edge: 20px; --gap: 20px; }
  body::before { width: 4px; }
  .side { position: static; width: auto; padding: 32px var(--gr) 8px var(--gl); }
  .logo { font-size: 2.6rem; margin-bottom: 20px; }
  .side nav ul { display: flex; flex-wrap: wrap; gap: 0 22px; }
  .side nav a { padding: 8px 0; }
  .copy { display: none; }
  main { margin-left: 0; padding: 28px var(--gr) 0 var(--gl); }
  .strip { flex-direction: column; height: auto; min-height: 0; overflow: visible; padding-right: 0; }
  .slide { width: 100%; height: auto; }
  .slide img { width: 100%; height: auto; }
  .page { padding-right: 0; }
  .rows { grid-template-columns: 1fr; gap: 4px; margin-bottom: 40px; }
  .rows dd { margin-bottom: 20px; }
  .gal, .compare, .split { grid-template-columns: 1fr; }
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gal3 { grid-template-columns: 1fr; }
  .masonry { columns: 1; }
  .strip-nav { display: none; }
  .gal3 .w2 { grid-column: auto; }
  .slide .ph { min-height: 240px; }
  footer.mobile-copy { display: block; padding: 24px var(--gr) 40px var(--gl); font-size: .8rem; }
}
@media (min-width: 861px) { footer.mobile-copy { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* before / after pairs */
.ba-block { margin: 0 0 56px; }
.ba-block h3 { font-size: 1.1rem; font-weight: 500; margin: 0 0 14px; }
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.ba figure { margin: 0; min-width: 0; position: relative; }
.ba .zoom { display: block; box-shadow: 0 0 0 1px var(--line, #ddd9d0); }
.ba img { display: block; width: 100%; height: auto; }
.ba-tag { display: inline-block; font-size: .9rem; font-weight: 700; padding: 4px 10px; margin-bottom: 10px; color: #fff; background: var(--muted); }
.ba .after .ba-tag { background: var(--leaf); }
.ba-note { margin: 14px 0 0; max-width: 640px; }

/* featured research highlights */
.rh-feature { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 48px; align-items: start; margin-bottom: 56px; }
.rh-feature figure { margin: 0; }
.cards.three { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.more-h { font-size: 1rem; font-weight: 700; margin: 8px 0 12px; }
.morelist { list-style: none; margin: 0 0 40px; padding: 0; max-width: 760px; }
.morelist li { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-top: 1px solid var(--line, #ddd9d0); }
.morelist li:last-child { border-bottom: 1px solid var(--line, #ddd9d0); }
.morelist .ml { white-space: nowrap; font-size: .9rem; }
.morelist a { color: var(--accent); text-underline-offset: 4px; }
@media (max-width: 860px) {
  .rh-feature { grid-template-columns: 1fr; gap: 20px; }
  .ba { gap: 12px; grid-template-columns: 1fr !important; }
  .ba-tag { font-size: .8rem; padding: 3px 6px; }
  .morelist li { flex-direction: column; gap: 4px; }
}

/* logo mark exploration */
.logogrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 8px 0 16px; }
.logogrid figure { margin: 0; min-width: 0; }
.logogrid .zoom { display: block; aspect-ratio: 4 / 3; background: #fff; box-shadow: 0 0 0 1px var(--line, #ddd9d0); }
.logogrid img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 860px) { .logogrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* nested nav: accessible design sits under brand */
.side nav li ul { list-style: none; margin: 0 0 4px; padding: 0 0 0 16px; }
.side nav li li a { font-size: .98rem; padding: 7px 0; color: var(--muted); }
.side nav li li a:hover { color: var(--leaf); }
.side nav li li a[aria-current="page"] { color: var(--accent); }
.side nav li.parent > a { color: var(--accent); }
.crumb { margin: 0 0 6px; font-size: .95rem; color: var(--muted); }
.crumb a { color: var(--accent); text-underline-offset: 4px; }
.jump { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: .98rem; }
.jump a { color: var(--accent); text-underline-offset: 4px; }
@media (max-width: 860px) {
  .side nav li, .side nav li ul { display: contents; }
  .side nav li li a { color: var(--ink); font-size: 1.05rem; padding: 8px 0; }
  .side nav li li a[aria-current="page"] { color: var(--accent); }
  .side nav li.parent > a { color: var(--ink); }
}

/* tools at a glance */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tool-group { border: 1px solid var(--line, #ddd9d0); padding: 20px 22px 22px; background: #fff; border-top: 3px solid var(--pink-soft); }
.tool-group:nth-child(even) { border-top-color: var(--green-soft); }
.tool-group h3 { font-size: 1rem; font-weight: 700; margin: 0 0 14px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 1rem; padding: 6px 14px; border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); line-height: 1.3; }
@media (max-width: 860px) { .tools { grid-template-columns: 1fr; } }

/* featured research highlights, side by side but large enough to read */
.rh-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-bottom: 48px; align-items: start; }
.rh-item figure { margin: 0; }
.feature-detail { max-width: 760px; margin-bottom: 40px; }
.feature-detail figure { margin: 0; }
.bio { max-width: 680px; }
.bio p { margin: 0 0 1.1em; font-size: 1.1rem; line-height: 1.65; }
@media (max-width: 860px) { .rh-pair { grid-template-columns: 1fr; gap: 40px; } }
