/* ==========================================================================
   Sujal Maharjan — portfolio stylesheet
   Plain CSS, no build step. Sections:
   1. Tokens (light + dark)   2. Base     3. Layout & utilities
   4. Header / nav            5. Hero     6. Sections (about, timeline, ...)
   7. Cards / chips / prints  8. Lightbox 9. Footer   10. Motion & a11y
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* EDIT: colours live here. Change once, applies everywhere. */
  --paper: #F6F4EE;        /* page background */
  --surface: #FBFAF6;      /* cards */
  --ink: #22302E;          /* main text */
  --muted: #5F6B67;        /* secondary text */
  --pencil: #D8DCD2;       /* borders, lines */
  --sage: #8FAE9C;         /* secondary accent (decorative) */
  --teal: #2F5D62;         /* primary accent: links, buttons */
  --slate: #6C8A9B;        /* tertiary accent: tags */
  --slate-text: #45606E;   /* darker slate so tag text passes AA */
  --on-accent: #FFFFFF;    /* text on teal buttons */
  --shadow: 0 1px 2px rgba(34, 48, 46, .05), 0 10px 24px -14px rgba(34, 48, 46, .25);
  --shadow-lift: 0 2px 4px rgba(34, 48, 46, .06), 0 18px 36px -16px rgba(34, 48, 46, .3);
  --grain-opacity: .035;
  --dot: rgba(34, 48, 46, .13);   /* bullet-journal dot grid */
  --show-sun: none;        /* theme toggle icons */
  --show-moon: inline;

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;

  --max: 1080px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 10px;
  /* Sketchbook touch #3: slightly imperfect border (project cards only) */
  --sketch-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  /* milder version for art frames */
  --sketch-radius-sm: 14px 5px 12px 5px / 5px 12px 5px 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* Dark theme: follows the OS unless the user picked "light" explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151C1B;
    --surface: #1C2524;
    --ink: #E7EBE6;
    --muted: #A3ADA9;
    --pencil: #2F3A38;
    --sage: #A3C2B1;
    --teal: #7FB3B8;
    --slate: #8FA9B8;
    --slate-text: #A9C1CE;
    --on-accent: #151C1B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 36px -16px rgba(0, 0, 0, .7);
    --grain-opacity: .05;
    --dot: rgba(231, 235, 230, .10);
    --show-sun: inline;
    --show-moon: none;
    color-scheme: dark;
  }
}

/* Dark theme: user picked "dark" explicitly via the toggle */
:root[data-theme="dark"] {
  --paper: #151C1B;
  --surface: #1C2524;
  --ink: #E7EBE6;
  --muted: #A3ADA9;
  --pencil: #2F3A38;
  --sage: #A3C2B1;
  --teal: #7FB3B8;
  --slate: #8FA9B8;
  --slate-text: #A9C1CE;
  --on-accent: #151C1B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 36px -16px rgba(0, 0, 0, .7);
  --grain-opacity: .05;
  --dot: rgba(231, 235, 230, .10);
  --show-sun: inline;
  --show-moon: none;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* keep anchors clear of the sticky nav */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  /* Bullet-journal dot grid: 1px dots every 24px. Set --dot to transparent to remove. */
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  overflow-x: hidden; /* never scroll sideways */
  overflow-wrap: anywhere;
}

/* Sketchbook touch #1: faint paper grain (inline SVG noise, < 4 % in light mode) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; }
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-family: var(--font-sans); font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
small, .small { font-size: .875rem; }
sub, sup { line-height: 0; font-size: .7em; }
.muted { color: var(--muted); }

a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .15em;
  transition: color .2s var(--ease);
}
a:hover { text-decoration-thickness: 2px; }

/* Visible focus for everything, keyboard-only where supported */
:focus { outline: 2px solid var(--teal); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }

::selection { background: color-mix(in srgb, var(--sage) 45%, transparent); }

/* Handwritten accent — annotations ONLY (sketchbook touch #4) */
.annot {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--teal);
  letter-spacing: .01em;
}

/* ---------- 3. Layout & utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) + env(safe-area-inset-left)) calc(var(--gutter) + env(safe-area-inset-right));
}

.section { padding-block: clamp(3.5rem, 9vw, 6rem); }
.section + .section { padding-top: 0; }

.section-head { margin-bottom: clamp(1.75rem, 4vw, 2.5rem); }
.section-head .annot { display: block; margin-bottom: .25rem; }
.section-title {
  position: relative;
  display: inline-block;
  padding-bottom: .35rem;
}
/* Sketchbook touch #2: ink flourish under section headings.
   The symbol is right-anchored (xMaxYMid slice) so the loop keeps its shape
   on short and long headings alike; the line simply extends to the left. */
.squiggle {
  position: absolute;
  left: 0;
  bottom: -.42em;
  width: 100%;
  height: .5em;
  color: var(--sage);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: .6rem 1rem;
  background: var(--teal);
  color: var(--on-accent);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top)); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lede { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }

/* Sketchbook touch #6: tiny single-line doodle dividers */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding-inline: var(--gutter);
  color: var(--muted);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pencil);
}
.divider svg { width: 26px; height: 26px; opacity: .8; }

/* ---------- 4. Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pencil);
  padding-top: env(safe-area-inset-top);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--teal); }

.nav-list {
  display: flex;
  gap: .25rem;
  list-style: none;
}
.nav-list a {
  display: block;
  padding: .45rem .7rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-list a:hover,
.nav-list a[aria-current] {
  color: var(--teal);
  background: color-mix(in srgb, var(--sage) 16%, transparent);
}

.nav-actions { display: flex; align-items: center; gap: .25rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { color: var(--teal); background: color-mix(in srgb, var(--sage) 16%, transparent); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-sun { display: var(--show-sun); }
.icon-moon { display: var(--show-moon); }
.icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Narrow screens (< 760 px): the chapter links stay visible as a slim,
   horizontally scrollable row under the name — no hamburger needed. */
.nav-toggle { display: none; }
@media (max-width: 759.98px) {
  html { scroll-padding-top: 6.75rem; }
  .nav-bar { flex-wrap: wrap; min-height: 0; padding-top: .55rem; }
  .brand { order: 0; }
  .nav-actions { order: 1; }
  .site-nav {
    order: 2;
    flex-basis: 100%;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-list { width: max-content; gap: 0; padding: .1rem 0 .55rem; }
  .nav-list a { padding: .35rem .55rem; font-size: .875rem; }
}
/* Between 760 and 900 px the full nav fits on one line, just more compact */
@media (min-width: 760px) and (max-width: 899.98px) {
  .brand { font-size: 1.05rem; }
  .nav-list { gap: 0; }
  .nav-list a { padding: .4rem .45rem; font-size: .85rem; }
}

/* ---------- 5. Hero ---------- */
.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(3rem, 8vw, 5rem); }
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.hero h1 { margin: .1em 0 .4em; }
.hero .tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 28ch;
  text-wrap: pretty;
}
.hero .intro { color: var(--muted); max-width: 52ch; }
.hero-photo { width: min(72%, 300px); margin-top: .5rem; }
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; gap: 3rem; }
  .hero-photo { justify-self: end; width: min(100%, 320px); margin-top: 0; }
}

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border: 1px solid var(--teal);
  border-radius: 999px;
  font-weight: 500;
  font-size: .975rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--teal);
  transition: transform .25s var(--ease), background .2s var(--ease), color .2s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.btn--primary { background: var(--teal); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--teal) 88%, var(--ink)); }
.btn--ghost { border-color: var(--pencil); color: var(--ink); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- 6. Sections ---------- */

/* About */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.5fr 1fr; gap: 4rem; } }
.about-text p { max-width: 68ch; }
.edu {
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--pencil);
  border-radius: var(--radius);
  background: var(--surface);
}
.edu h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.edu .where { color: var(--muted); margin-bottom: .9rem; }
.edu .coursework { font-size: .85rem; color: var(--muted); line-height: 1.55; }
.edu .coursework strong { color: var(--ink); font-weight: 600; }
.subhead {
  display: block;
  margin: 1.75rem 0 .6rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Chips (interests, tools, skills) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  list-style: none;
}
.chips li {
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--slate-text);
  background: color-mix(in srgb, var(--slate) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--slate) 35%, transparent);
}
.chips--tools li { font-size: .78rem; padding: .22rem .6rem; }

/* Timeline (experience) */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: .45rem;
  top: .5rem;
  bottom: .5rem;
  width: 1px;
  background: var(--pencil);
}
.timeline > li { position: relative; padding-bottom: 2.5rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: .55rem;
  width: .95rem;
  height: .95rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--sage);
}
.tl-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; margin-bottom: .6rem; }
.tl-meta h3 { margin: 0; font-size: 1.2rem; }
.tl-meta .org { color: var(--muted); }
.tl-meta .date { color: var(--teal); font-family: var(--font-hand); font-size: 1.15rem; }

.tl-desc { max-width: 72ch; }

.bullets { list-style: none; }
.bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: .5rem;
  color: var(--ink);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .45rem;
  height: 1px;
  background: var(--sage);
}
.bullets li:last-child { margin-bottom: 0; }

/* Projects */
.grid-2 { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; } }

/* ---------- 7. Cards / prints ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--pencil);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--sage) 60%, var(--pencil)); }

/* Project cards get the slightly imperfect "pencil" border */
.project {
  border-radius: var(--sketch-radius);
  padding: 1.6rem 1.75rem 1.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.project-media {
  position: relative;
  margin: -.35rem -.5rem 1.1rem;
  border: 1px solid var(--pencil);
  border-radius: 8px 3px 7px 3px / 3px 7px 3px 8px;
  overflow: hidden;
  background: var(--paper);
}
.project-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.project:hover .project-media img { transform: scale(1.02); }
.project-media.is-missing img { visibility: hidden; }
.project-media.is-missing::after {
  content: "project image";
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding-top: 2.4rem;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--muted);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FAE9C' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5-5-8 9'/%3E%3C/svg%3E") center 36% / 30px no-repeat,
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--pencil) 45%, transparent) 10px 11px),
    var(--paper);
}
.project-title { font-size: 1.2rem; margin-bottom: .6rem; }
.project .chips { margin-bottom: .85rem; }
.project-summary { color: var(--muted); font-size: .975rem; }
.project-details { margin-top: auto; padding-top: .9rem; }
.project-details summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--teal);
  font-weight: 500;
  font-size: .925rem;
  cursor: pointer;
  width: max-content;
}
.project-details summary::-webkit-details-marker { display: none; }
.project-details summary::after {
  content: "";
  width: .5rem; height: .5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s var(--ease);
}
.project-details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.project-details .less, .project-details[open] .more { display: none; }
.project-details[open] .less { display: inline; }
.project-details .bullets { margin-top: 1rem; font-size: .95rem; }
.card-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .9rem; }
.card-links a[href=""], .card-links a:not([href]) { display: none; } /* empty slots hide */
.card-links:not(:has(a[href]:not([href=""]))) { display: none; }

/* Awards */
.award { display: grid; gap: .4rem; }
.award--highlight {
  padding: 1.6rem 1.75rem;
  border-color: color-mix(in srgb, var(--sage) 55%, var(--pencil));
  background: linear-gradient(135deg, color-mix(in srgb, var(--sage) 10%, var(--surface)), var(--surface) 60%);
}
.award-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.award-head h3 { margin: 0; font-size: 1.25rem; }
.award .year { font-family: var(--font-hand); font-size: 1.15rem; color: var(--teal); }
.award .org { color: var(--muted); font-size: .95rem; }
.award .bullets { margin-top: .75rem; font-size: .95rem; }
.award-desc { margin-top: .5rem; font-size: .975rem; max-width: 70ch; }
.award-cards { display: grid; gap: 1.25rem; }
.award-list { list-style: none; margin-top: 1rem; }
.award-list { margin-top: 0; }
.award-list li { padding: 1.1rem 0; border-top: 1px solid var(--pencil); }
.award-list li:last-child { border-bottom: 1px solid var(--pencil); }
.award-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .75rem; }
.award-list .what { font-weight: 500; }
.award-list .org { color: var(--muted); font-size: .95rem; margin-top: .15rem; }
.award-list .desc { color: var(--muted); font-size: .95rem; margin-top: .35rem; max-width: 70ch; }
.award-list .bullets { margin-top: .6rem; font-size: .95rem; max-width: 78ch; }
.award-list .bullets li { padding-top: 0; padding-bottom: 0; border: 0; }

/* Leadership / outreach */
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.two-col h3 { font-size: 1.1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--pencil); margin-bottom: 1rem; }
.role-list { list-style: none; }
.role-list li { padding: .85rem 0; border-bottom: 1px dashed var(--pencil); }
.role-list li:last-child { border-bottom: 0; }
.role-list .role { font-weight: 600; }
.role-list .org { color: var(--muted); }
.role-list .date { color: var(--teal); font-family: var(--font-hand); font-size: 1.1rem; margin-left: .35rem; white-space: nowrap; }
.role-list .desc { font-size: .95rem; color: var(--muted); margin-top: .2rem; }

/* Skills */
.skill-groups { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .skill-groups { grid-template-columns: 1fr 1fr; gap: 1.75rem 3rem; } }
.skill-group h3 { font-family: var(--font-sans); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }

/* Pinned prints (sketchbook touch #5) */
.print {
  --tilt: 0deg;
  position: relative;
  margin: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--pencil);
  border-radius: var(--sketch-radius-sm);
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt));
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.print:hover, .print:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-lift); }
.print img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px 3px 7px 3px / 3px 7px 3px 8px;
  background: var(--paper);
}
.print--photo img { aspect-ratio: 4 / 5; }
.print figcaption { padding: .4rem .35rem .1rem; font-size: 1.1rem; color: var(--muted); }
.print figcaption .medium { opacity: .8; }
/* a subtle "pin" */
.print::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px; height: 9px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  z-index: 1;
}
/* alternate gentle tilts, all within ±1.2° */
.art-grid .print:nth-child(4n+1) { --tilt: -1deg; }
.art-grid .print:nth-child(4n+2) { --tilt: .8deg; }
.art-grid .print:nth-child(4n+3) { --tilt: -.5deg; }
.art-grid .print:nth-child(4n+4) { --tilt: 1.1deg; }
.hero-photo .print { --tilt: 1deg; }

/* Missing image → CSS-drawn placeholder (layout never breaks) */
.print.is-missing img { visibility: hidden; }
.print.is-missing::after {
  content: "image goes here";
  position: absolute;
  inset: 6px 6px auto 6px;
  aspect-ratio: 4 / 5;
  display: grid;
  place-content: center;
  padding-top: 1.25rem;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--muted);
  text-align: center;
  border-radius: 8px 3px 7px 3px / 3px 7px 3px 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FAE9C' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5-5-8 9'/%3E%3C/svg%3E") center 38% / 34px no-repeat,
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--pencil) 45%, transparent) 10px 11px),
    var(--paper);
}

.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; padding: .5rem .25rem; }
@media (min-width: 640px) { .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 1.5rem; } }
@media (min-width: 1024px) { .art-grid--wide { gap: 2.25rem 2rem; padding-inline: 1rem; } }
.print-link { display: block; color: inherit; text-decoration: none; border-radius: 6px; }
.print-link:focus-visible { outline-offset: 2px; }

/* Contact */
.contact-card { text-align: left; }
.contact-card .big { font-family: var(--font-serif); font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.35; max-width: 30ch; }
.social { display: flex; gap: .5rem; list-style: none; margin-top: 1.25rem; }
.social a {
  display: inline-grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--pencil);
  border-radius: 50%;
  color: var(--muted);
  transition: all .25s var(--ease);
}
.social a:hover { color: var(--teal); border-color: var(--teal); transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; }

/* ---------- 8. Lightbox (art.html) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1000px);
  max-height: 100%;
  display: grid;
  gap: .6rem;
  justify-items: center;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  max-height: calc(100dvh - 8rem);
  width: auto;
  object-fit: contain;
  border: 6px solid var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow-lift);
  background: var(--surface);
}
.lightbox-caption { color: #F6F4EE; text-align: center; font-size: 1.25rem; }
.lightbox .icon-btn {
  position: absolute;
  color: #F6F4EE;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15);
  width: 2.75rem; height: 2.75rem;
}
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.lightbox-close { top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); }
.lightbox-prev { left: max(.5rem, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: max(.5rem, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.lightbox-count { position: absolute; top: max(1.4rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #F6F4EE; font-size: .9rem; opacity: .8; }
body.lightbox-open { overflow: hidden; }

.page-title { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1.5rem; }
.page-title h1 { margin-bottom: .2em; }
.page-intro { font-size: 1.5rem; color: var(--muted); }

/* ---------- 9. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--pencil);
  padding: 1.75rem 0 calc(1.75rem + env(safe-area-inset-bottom));
  font-size: .875rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--teal); }

/* ---------- 10. Motion & accessibility ---------- */
/* Soft fade-up on scroll — only when JS is running, otherwise content is just visible */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal:nth-child(2) { transition-delay: .06s; }
.js .reveal:nth-child(3) { transition-delay: .12s; }
.js .reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .print, .print:hover { transform: none; }
  .project:hover .project-media img { transform: none; }
  .card:hover, .btn:hover, .social a:hover { transform: none; }
}

@media print {
  .site-header, .grain, .btn-row, .filter, .site-footer a { display: none !important; }
  .project-details { display: block; }
  body { background: #fff; color: #000; }
}
