/* ==========================================================================
   vidunjayakody.com
   Every colour, size and space token lives in :root. Change them here.
   ========================================================================== */

:root {
  /* Colour */
  --bg:         #13110F;  /* warm charcoal, matched to the hero wall */
  --bg-raised:  #1B1815;  /* cards, filter track */
  --bg-sunk:    #0F0D0C;  /* footer */
  --line:       #2C2722;  /* hairlines and borders */
  --line-soft:  #221E1A;
  --text:       #EEE7DC;  /* 15.4:1 on --bg */
  --text-dim:   #A89F92;  /* 7.1:1 on --bg */
  --sand:       #E8CFA6;  /* primary button fill */
  --sand-ink:   #1E1812;  /* text on --sand */
  --gold:       #C8A272;  /* line icons, eyebrow, active nav */
  --taupe:      #B7A389;  /* surname in the hero */

  /* Type */
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-deva: "Noto Serif Devanagari", serif;

  --fs-display: clamp(2.9rem, 1.6rem + 4.6vw, 5.4rem);
  --fs-h1:      clamp(2.3rem, 1.6rem + 2.6vw, 3.6rem);
  --fs-h2:      clamp(1.75rem, 1.4rem + 1.2vw, 2.3rem);
  --fs-h3:      1.2rem;
  --fs-lede:    clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  --fs-body:    1.0625rem;
  --fs-small:   0.9375rem;
  --fs-micro:   0.75rem;

  /* Space & layout */
  --wrap: 1200px;
  --gutter: clamp(1rem, 0.4rem + 3vw, 3rem);
  --header-h: 76px;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--sand); color: var(--sand-ink); }

:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--sand); color: var(--sand-ink);
  padding: .6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.icon { width: 1em; height: 1em; flex: none; }
.icon--line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  height: var(--header-h);
}
.site-header--solid { position: relative; border-bottom: 1px solid var(--line-soft); }
.site-header .wrap {
  height: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem;
}

.brand { display: inline-flex; align-items: center; gap: .75rem; font-size: 1.125rem; letter-spacing: .005em; justify-self: start; }
.brand .icon { width: 34px; height: 26px; color: var(--gold); }

.nav ul { display: flex; gap: clamp(1.5rem, 3vw, 3rem); }
.nav a {
  position: relative; display: block; padding: .5rem 0;
  font-size: var(--fs-small); color: var(--text);
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transition: transform .3s var(--ease);
}
.nav a:hover::after { transform: scaleX(.6); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--sand); }

.socials { display: flex; gap: 1.25rem; justify-self: end; }
.socials a { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text); transition: color .2s; }
.socials a:hover { color: var(--sand); }
.socials svg { width: 22px; height: 22px; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .site-header .wrap { grid-template-columns: 1fr auto; }
  .socials { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    justify-self: end; padding: .5rem .25rem; font-size: var(--fs-small);
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .nav {
    position: absolute; top: var(--header-h); left: var(--gutter); right: var(--gutter);
    background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: .5rem 1.25rem 1.25rem;
    display: none;
  }
  .nav[data-open] { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: .85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
  .nav a::after { display: none; }
  .nav .socials { display: flex; margin-top: 1rem; justify-content: flex-start; }
}
@media (min-width: 861px) { .nav .socials { display: none; } }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .65rem;
  height: 52px; padding: 0 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem; font-weight: 500; letter-spacing: .005em;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn .icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn--primary { background: var(--sand); color: var(--sand-ink); }
.btn--primary:hover { background: #F1DDBB; }
.btn--primary:hover .icon { transform: translate(2px, -2px); }
.btn--ghost { border: 1px solid rgba(232, 207, 166, .55); color: var(--text); }
.btn--ghost:hover { border-color: var(--sand); background: rgba(232, 207, 166, .06); }
.btn--ghost:hover .icon { transform: translateY(2px); }

.text-link {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--sand); border-bottom: 1px solid rgba(232, 207, 166, .35);
  padding-bottom: 2px; transition: border-color .2s;
}
.text-link:hover { border-color: var(--sand); }
.text-link .icon { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: clamp(560px, 37vw + 80px, 700px);
  display: flex; align-items: center;
  isolation: isolate;
  overflow: hidden;
}
.hero__photo {
  position: absolute; z-index: -1;
  top: 0; right: 0; bottom: 0;
  width: min(64%, 1100px);
  /* fade the photo into the page on its left and bottom edges */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 34%),
    linear-gradient(to top, transparent 0, #000 32%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent 0, #000 34%),
    linear-gradient(to top, transparent 0, #000 32%);
          mask-composite: intersect;
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 20%;
}
/* the light falls on the wall to the left of the photo too */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 80% at 46% 70%, rgba(170, 140, 104, .16), transparent 70%),
    radial-gradient(40% 60% at 20% 30%, rgba(120, 100, 80, .08), transparent 70%),
    linear-gradient(180deg, #1A1714 0%, var(--bg) 100%);
}

.hero__copy { position: relative; padding-top: calc(var(--header-h) + 1rem); padding-bottom: 3rem; max-width: 640px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-size: var(--fs-micro); font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::after { content: ""; width: 14px; height: 1px; background: currentColor; }

.hero__title {
  margin-top: 1.25rem;
  font-size: var(--fs-display); font-weight: 300;
  line-height: 1; letter-spacing: -.025em;
}
.hero__title .surname { color: var(--taupe); }

.hero__intro {
  margin-top: 1.75rem; max-width: 34em;
  font-size: var(--fs-lede); font-weight: 300; line-height: 1.55;
  color: #D9D1C5;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }

/* The one orchestrated moment: the light comes in.
   Brightness and opacity play for everyone, including people who ask for
   reduced motion (Windows "Animation effects" off); only movement is gated. */
.js .hero__photo img { filter: brightness(.35) saturate(.6); }
.js:not(.motion) .hero [data-rise] { opacity: 0; }
.is-lit .hero__photo img {
  filter: none;
  transition: filter 2.2s cubic-bezier(.3, .1, .2, 1), transform 2.6s var(--ease);
}
.js:not(.motion).is-lit .hero [data-rise] {
  opacity: 1;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(.35s + var(--i, 0) * .09s);
}
@media (prefers-reduced-motion: no-preference) {
  .js .hero__photo img { transform: scale(1.04); }
  .js:not(.motion) .hero [data-rise] { transform: translateY(14px); }
  .is-lit .hero__photo img, .js:not(.motion).is-lit .hero [data-rise] { transform: none; }
}

@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero__photo {
    position: relative; width: 100%; height: auto; aspect-ratio: 4 / 3.4;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 35%);
            mask-image: linear-gradient(to top, transparent 0, #000 35%);
  }
  .hero__photo img { object-position: 70% 30%; }
  .hero::before { background: var(--bg); }
  .hero__copy { padding-top: 0; margin-top: -4.5rem; }
}

/* --------------------------------------------------------------------------
   Pillars
   -------------------------------------------------------------------------- */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.pillar {
  display: flex; gap: 1.5rem; align-items: flex-start;
  padding-inline: clamp(1rem, 3vw, 3rem);
}
.pillar + .pillar { border-left: 1px solid var(--line); }
.pillar:first-child { padding-left: clamp(0rem, 2vw, 2.5rem); }
.pillar__icon { width: 40px; height: 40px; flex: none; color: var(--gold); display: grid; place-items: center; }
.pillar__icon svg { width: 38px; height: 38px; }
.pillar__icon .om { font-family: var(--font-deva); font-size: 34px; line-height: 1; font-weight: 300; transform: translateY(-2px); }
.pillar h2 { font-size: var(--fs-h3); font-weight: 400; line-height: 1.3; }
.pillar p { margin-top: .4rem; font-size: var(--fs-small); color: var(--text-dim); max-width: 36ch; line-height: 1.5; }
strong { font-weight: 500; color: var(--text); }

@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; padding-block: 1rem; }
  .pillar, .pillar:first-child { padding: 1.25rem 0; }
  .pillar + .pillar { border-left: 0; border-top: 1px solid var(--line-soft); }
  .pillar p { max-width: none; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 8vw, 6.5rem); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; margin-bottom: 2rem;
}
.section__title { font-size: var(--fs-h2); font-weight: 400; letter-spacing: -.015em; line-height: 1.15; }


/* --------------------------------------------------------------------------
   Work grid & tiles
   -------------------------------------------------------------------------- */
.work-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1000px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .work-grid { grid-template-columns: 1fr; } }

.tile {
  position: relative; display: block;
  aspect-ratio: 16 / 7.4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  transition: border-color .3s;
}
.tile[hidden] { display: none; }
.tile:hover { border-color: #3C352D; }

/* Project tile */
.tile--project { padding: 2rem 2.25rem; display: flex; flex-direction: column; justify-content: flex-end; }
.tile--project .tile__wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tile--project .tile__icon { position: relative; width: 40px; height: 40px; color: var(--text); margin-bottom: auto; }
.tile--project .tile__icon svg { width: 40px; height: 40px; }
.tile__title { position: relative; font-size: 1.15rem; font-weight: 400; line-height: 1.3; }
.tile__desc { position: relative; margin-top: .35rem; font-size: .875rem; color: var(--text-dim); max-width: 30ch; line-height: 1.5; }
.tile__arrow {
  position: absolute; right: 2rem; bottom: 1.85rem;
  width: 20px; height: 20px; color: var(--text);
  transition: transform .3s var(--ease), color .2s;
}
.tile--project:hover .tile__arrow { transform: translateX(4px); color: var(--sand); }

/* Art tile */
.tile--art img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), filter .4s;
}
.tile--art:hover img { transform: scale(1.03); }
.tile--art .tile__caption {
  position: absolute; inset: auto 0 0 0;
  padding: 2.5rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(10, 8, 7, .88), transparent);
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.tile--art:hover .tile__caption,
.tile--art:focus-visible .tile__caption { opacity: 1; transform: none; }
.tile--art .tile__caption .tile__title { font-size: 1rem; }
.tile--art .tile__caption span { display: block; font-size: .8125rem; color: var(--text-dim); }
@media (hover: none) { .tile--art .tile__caption { opacity: 1; transform: none; } }

.empty-note { color: var(--text-dim); padding: 2rem 0; }

/* --------------------------------------------------------------------------
   Inner page head
   -------------------------------------------------------------------------- */
.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-head .eyebrow { margin-bottom: 1.25rem; }
.page-title { font-size: var(--fs-h1); font-weight: 300; letter-spacing: -.02em; line-height: 1.05; }
.page-sub { margin-top: 1.25rem; max-width: 36em; font-size: var(--fs-lede); font-weight: 400; color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Projects page
   -------------------------------------------------------------------------- */
.project-list { display: grid; gap: 20px; }
.project {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: var(--bg-raised); overflow: hidden;
  min-height: 300px;
}
.project__visual { position: relative; border-right: 1px solid var(--line-soft); display: grid; place-items: center; }
.project__visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.project__visual svg { position: relative; width: 64px; height: 64px; color: var(--gold); }
.project__body { padding: clamp(1.75rem, 3vw, 2.75rem); display: flex; flex-direction: column; }
.project__meta { font-size: var(--fs-small); color: var(--gold); }
.project__title { margin-top: .5rem; font-size: 1.6rem; font-weight: 400; line-height: 1.2; letter-spacing: -.01em; }
.project__desc { margin-top: .9rem; color: var(--text-dim); max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.tag { font-size: .8125rem; padding: .3rem .75rem; border-radius: var(--radius-pill); border: 1px solid var(--line); color: #CFC6B8; }
.project__links { margin-top: auto; padding-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 1.5rem; }
@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; }
  .project__visual { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

/* --------------------------------------------------------------------------
   Art page
   -------------------------------------------------------------------------- */
.gallery {
  display: grid; gap: clamp(20px, 3vw, 40px) clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}
.piece:nth-child(3n+2) { margin-top: clamp(0px, 6vw, 80px); }
.piece__frame {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-soft); background: var(--bg-raised);
  aspect-ratio: 7 / 10;
}
.piece__frame img { width: 100%; height: 100%; object-fit: cover; }
.piece figcaption { display: grid; gap: .1rem; padding: .9rem .25rem 0; font-size: var(--fs-small); line-height: 1.4; }
.piece figcaption span { color: var(--text-dim); font-size: .8125rem; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } .piece:nth-child(3n+2) { margin-top: 0; } .piece:nth-child(2n) { margin-top: 48px; } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } .piece:nth-child(2n) { margin-top: 0; } }

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */
.about {
  display: grid; gap: clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: start;
}
/* Bio reads larger than default body text: 19-21px depending on screen */
.about .prose { font-size: clamp(1.1875rem, 1.05rem + .35vw, 1.3125rem); line-height: 1.65; max-width: 34em; }
.about .prose > * + * { margin-top: 1.1em; }
.about .facts { font-size: 1rem; }
.about__portrait { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-soft); }
.about__portrait img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; filter: saturate(.8) sepia(.12) brightness(.92); }
.facts { margin-top: 1.5rem; display: grid; gap: 1rem; font-size: var(--fs-small); }
.facts dt { color: var(--gold); }
.facts dd { color: #CFC6B8; }
.facts a { border-bottom: 1px solid var(--line); }
.facts a:hover { color: var(--sand); border-color: var(--sand); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about aside { max-width: 420px; } }

.prose { max-width: 66ch; }
.prose > * + * { margin-top: 1.15em; }
.prose p { color: #D7CFC3; }
.prose .lede { font-size: var(--fs-lede); font-weight: 400; color: var(--text); line-height: 1.55; }
.prose h2 { margin-top: 2.2em; font-size: 1.6rem; font-weight: 400; letter-spacing: -.01em; line-height: 1.25; color: var(--text); }
.prose h3 { margin-top: 1.8em; font-size: 1.2rem; font-weight: 500; color: var(--text); }
.prose a { color: var(--sand); border-bottom: 1px solid rgba(232, 207, 166, .35); }
.prose a:hover { border-color: var(--sand); }
.prose ul { padding-left: 1.2em; list-style: disc; }
.prose ul li::marker { color: var(--gold); }
.prose li + li { margin-top: .4em; }
.prose blockquote { border-left: 2px solid var(--gold); padding: .25em 0 .25em 1.25em; font-size: 1.15rem; font-weight: 300; }
.prose code { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: .9em; background: var(--bg-raised); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.1rem 1.25rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { margin-top: .6rem; font-size: var(--fs-small); color: var(--text-dim); }

.timeline { margin-top: 1rem; border-top: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: .25rem 2rem;
  padding-block: 1.5rem; border-bottom: 1px solid var(--line-soft);
}
.role__when { font-size: var(--fs-small); color: var(--text-dim); padding-top: .2rem; }
.role--now .role__when { color: var(--gold); }
.role__title { font-size: 1.15rem; font-weight: 400; }
.role__org { color: var(--taupe); font-size: var(--fs-small); }
.role__note { grid-column: 2; margin-top: .35rem; color: var(--text-dim); font-size: var(--fs-small); max-width: 60ch; }
@media (max-width: 620px) { .role { grid-template-columns: 1fr; } .role__note { grid-column: 1; } }

/* --------------------------------------------------------------------------
   Resume page
   -------------------------------------------------------------------------- */
.resume-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 2rem; }
.resume-head .btn .icon { width: 16px; height: 16px; }
.resume {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  align-items: start;
}
.resume .role { grid-template-columns: 150px minmax(0, 1fr); padding-block: 1.75rem; }
.resume .role__title { font-size: 1.25rem; }
.role__org span { color: var(--text-dim); margin-left: .5rem; }
.role__points { margin-top: .85rem; display: grid; gap: .45rem; }
.role__points li { position: relative; padding-left: 1.1rem; color: #CFC6B8; font-size: 1rem; line-height: 1.55; }
.role__points li::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 1px; background: var(--gold); }
.resume__side { display: grid; gap: 2.25rem; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.resume-block { padding-bottom: 2rem; border-bottom: 1px solid var(--line-soft); }
.resume-block__title { font-size: var(--fs-small); font-weight: 500; color: var(--gold); margin-bottom: .9rem; }
.resume-block__name { font-size: 1.15rem; }
.resume-block__meta { margin-top: .2rem; font-size: var(--fs-small); color: var(--text-dim); }
.skill-group + .skill-group { margin-top: 1.25rem; }
.skill-group h3 { font-size: var(--fs-small); font-weight: 400; color: #CFC6B8; }
.skill-group .tags { margin-top: .6rem; }
.resume__side > .text-link { justify-self: start; }
.resume__side > .text-link .icon { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .resume { grid-template-columns: 1fr; }
  .resume__side { position: static; }
}
@media (max-width: 620px) { .resume .role { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Writing
   -------------------------------------------------------------------------- */
.post-list { border-top: 1px solid var(--line); }
.post-item {
  position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: .25rem 2rem;
  padding-block: 1.6rem; border-bottom: 1px solid var(--line-soft);
}
.post-item time { font-size: var(--fs-small); color: var(--text-dim); padding-top: .2rem; }
.post-item h2 { font-size: 1.25rem; font-weight: 400; line-height: 1.3; }
.post-item h2 a::after { content: ""; position: absolute; inset: 0; }
.post-item:hover h2 { color: var(--sand); }
.post-item p { grid-column: 2; color: var(--text-dim); font-size: var(--fs-small); }
@media (max-width: 620px) { .post-item { grid-template-columns: 1fr; } .post-item p { grid-column: 1; } }

.post-meta { display: flex; gap: 1.25rem; font-size: var(--fs-small); color: var(--gold); margin-bottom: 1.25rem; }
.post-body { padding-block: clamp(2.5rem, 5vw, 4rem); }
.post-foot { padding-bottom: 5rem; }

/* Placeholders: replace and delete the wrapper */
.ph { background: rgba(200, 162, 114, .14); outline: 1px dashed rgba(200, 162, 114, .45); border-radius: 3px; padding: 0 .2em; }

.section-action { margin-top: 2.5rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--bg-sunk); border-top: 1px solid var(--line-soft); padding-block: 3.5rem 2.5rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; }
.footer__lead { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); font-weight: 300; letter-spacing: -.01em; }
.footer__lead a { color: var(--sand); border-bottom: 1px solid rgba(232, 207, 166, .35); }
.footer__lead a:hover { border-color: var(--sand); }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: var(--fs-small); }
.footer__links a { color: var(--text-dim); transition: color .2s; }
.footer__links a:hover { color: var(--sand); }
.footer__small { grid-column: 1 / -1; padding-top: 1.75rem; border-top: 1px solid var(--line-soft); font-size: var(--fs-micro); color: #958C80; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Merged sections: photography, contact, earlier projects
   -------------------------------------------------------------------------- */
.btn--small { height: 42px; padding: 0 1.1rem; font-size: var(--fs-small); font-weight: 400; }
.btn--small .icon { width: 18px; height: 18px; }
.section__lede { max-width: 40em; margin: 0 0 2rem; color: var(--text-dim); }
.section__head--sub { margin-top: clamp(3.5rem, 7vw, 5rem); }
.section-action .icon { width: 14px; height: 14px; }

.section--photo { border-top: 1px solid var(--line-soft); }
.photo-feed { min-height: 240px; border-radius: var(--radius-lg); overflow: hidden; }
.photo-feed behold-widget { display: block; }

.section--contact { background: linear-gradient(180deg, var(--bg) 0%, #16130F 100%); border-top: 1px solid var(--line-soft); }
.contact {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
}
.contact__intro .section__title { margin-bottom: 1.25rem; }
.contact__intro .section__lede { margin: 0 0 2.25rem; }
.contact__info { display: grid; gap: 1.4rem; }
.contact__info dt { display: flex; align-items: center; gap: .6rem; font-size: var(--fs-small); color: var(--gold); }
.contact__info dt .icon { width: 18px; height: 18px; }
.contact__info dd { margin: .2rem 0 0 calc(18px + .6rem); font-size: 1.1rem; }
.contact__info a { border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.contact__info a:hover { color: var(--sand); border-color: var(--sand); }

.contact__form {
  display: grid; gap: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--bg-raised); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
}
.field { display: grid; gap: .45rem; }
.field label { font-size: var(--fs-small); color: #CFC6B8; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .95rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sand); box-shadow: 0 0 0 3px rgba(232, 207, 166, .14); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #C97A62; }
.contact__form .btn { justify-self: start; }
.contact__form .btn[disabled] { opacity: .6; cursor: progress; }
.form-status { min-height: 1.5em; font-size: var(--fs-small); color: var(--text-dim); }
.form-status[data-state="sent"] { color: var(--sand); }
.form-status[data-state="error"] { color: #E3A08A; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

.work-grid--compact .tile--compact { aspect-ratio: auto; min-height: 210px; padding: 1.75rem 2rem; justify-content: flex-start; }
.tile--compact .tile__icon { color: var(--gold); margin-bottom: 1.75rem; }
.tile--compact .tile__icon svg { width: 34px; height: 34px; }
.tile--compact .tile__desc { padding-right: 2rem; }
.tile--compact .tile__arrow { bottom: 1.6rem; right: 1.75rem; }
.tile--compact:hover .tile__arrow { transform: translateX(4px); color: var(--sand); }

/* --------------------------------------------------------------------------
   Motion layer (js/motion.js). Static by default; .motion adds what
   scroll-linked animation needs. The page reads fine without any of it.
   -------------------------------------------------------------------------- */

/* Header end: socials */
.header__end { display: flex; align-items: center; gap: 1.25rem; justify-self: end; }
.header__end .socials { justify-self: auto; }
@media (max-width: 860px) {
  .site-header .wrap { grid-template-columns: 1fr auto auto; }
  .header__end { order: 2; }
  .nav-toggle { order: 3; }
  .header__end .socials { display: none; }
  .brand { white-space: nowrap; }
}

/* Hero copy entrance with motion on: a CSS animation that leaves no styles
   behind, so the scroll timeline in motion.js has sole control afterwards. */
@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
.motion .hero [data-rise] { animation: hero-rise .9s var(--ease) backwards; animation-delay: calc(.35s + var(--i, 0) * .09s); }

/* --------------------------------------------------------------------------
   Page transitions
   Chrome, Edge and Safari: native cross-document View Transitions. The header
   is its own layer so it holds still; the page lifts away and the next rises in.
   Firefox: js/site.js adds .fx-fallback and runs the same idea by hand.
   -------------------------------------------------------------------------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: .5s; }
::view-transition-old(root) { animation: page-out .32s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: page-in .58s var(--ease) .3s both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-28px); filter: blur(6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(40px); } }

/* A line of light sweeps under the header whenever a page arrives */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--sand) 35%, var(--sand) 65%, transparent);
  transform-origin: left; animation: header-sweep 1.2s var(--ease) .2s both;
}
@keyframes header-sweep {
  0% { transform: scaleX(0); opacity: 1; }
  65% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Fallback (no View Transitions). Fill mode "backwards" only, so no transform
   lingers on <main> afterwards: a leftover transform would break GSAP pinning. */
.fx-fallback main, .fx-fallback .site-footer { animation: page-in .62s var(--ease) .05s backwards; }
.fx-fallback.is-leaving main, .fx-fallback.is-leaving .site-footer {
  opacity: 0; transform: translateY(-28px); filter: blur(6px);
  transition: opacity .3s ease-in, transform .3s ease-in, filter .3s ease-in;
}

/* Fixed header over the pinned hero */
.motion .site-header:not(.site-header--solid) { position: fixed; transition: background-color .35s, border-color .35s, backdrop-filter .35s; border-bottom: 1px solid transparent; }
.motion .site-header.is-scrolled { background: rgba(19, 17, 15, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line-soft); }

/* Hero: window light and dusk layers */
.hero__light, .hero__dusk { position: absolute; inset: 0; pointer-events: none; }
.hero__light { z-index: 0; overflow: hidden; mix-blend-mode: soft-light; opacity: .9; }
.hero__light span {
  position: absolute; top: -20%; height: 140%; width: 9vw; left: 58%;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 180, .55) 45%, rgba(255, 226, 180, .55) 55%, transparent);
  transform: skewX(-18deg); filter: blur(10px);
}
.hero__light span:nth-child(2) { left: 70%; width: 6vw; }
.hero__light span:nth-child(3) { left: 80%; width: 11vw; opacity: .7; }
.hero__dusk {
  z-index: 0; opacity: 0;
  background:
    radial-gradient(70% 90% at 75% 40%, rgba(120, 40, 26, .35), transparent 70%),
    linear-gradient(180deg, rgba(19, 17, 15, .2), rgba(19, 17, 15, .85));
}
.hero__copy { z-index: 1; }
.intro { position: relative; background: var(--bg); }
.hero__photo { transform-origin: 70% 30%; will-change: transform; }

/* Photography aperture */
.photo-feed__inner { transform-origin: 50% 50%; }
.motion .photo-feed { will-change: clip-path; }

/* Art reel: a sideways gallery (native horizontal scroll without motion) */
.art-reel { position: relative; background: var(--bg); border-top: 1px solid var(--line-soft); }
.art-reel__inner { padding-block: clamp(3rem, 6vw, 4.5rem); display: flex; flex-direction: column; justify-content: center; gap: 2rem; }
.motion .art-reel__inner { min-height: 100vh; min-height: 100svh; padding-top: calc(var(--header-h) + 1.5rem); padding-bottom: 2rem; gap: 1.5rem; }
.art-reel__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.art-reel__head .section__lede { margin: .75rem 0 0; }
.art-reel__track {
  display: flex; gap: clamp(16px, 2vw, 28px);
  padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.motion .art-reel__track { overflow: visible; scroll-snap-type: none; will-change: transform; padding-block: 30px; }
/* trailing space so the last piece clears the edge (flex ignores end padding in scrollWidth) */
.art-reel__track::after { content: ""; flex: none; width: max(1px, calc(max(var(--gutter), calc((100vw - var(--wrap)) / 2)) - clamp(16px, 2vw, 28px))); }
/* width from the height left after header, title, captions and progress line (frames are 7:10) */
.reel-item { flex: none; width: clamp(200px, min(40vh, calc((100svh - 390px) * 0.7)), 440px); scroll-snap-align: start; }
.reel-item__frame { display: block; aspect-ratio: 7 / 10; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-soft); background: var(--bg-raised); }
.reel-item__frame img { width: 100%; height: 100%; object-fit: cover; }
.reel-item figcaption { display: grid; gap: .1rem; padding: .8rem .25rem 0; font-size: var(--fs-small); line-height: 1.35; }
.reel-item figcaption span { color: var(--text-dim); font-size: .8125rem; }
.art-reel__progress { height: 1px; background: var(--line); }
.art-reel__progress span { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(1); }
.motion .art-reel__progress span { transform: scaleX(0); }
@media (max-width: 860px) { .reel-item { width: 62vw; } }

/* Contact lotus */
.contact__intro { position: relative; }
.contact__lotus {
  position: absolute; z-index: -1; left: -4%; top: -5rem; width: min(520px, 100%); height: auto;
  fill: none; stroke: var(--gold); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; opacity: .4;
}
.section--contact { isolation: isolate; overflow: hidden; }

/* Split headings: keep descenders inside their masks */
.section__title, .page-title { overflow-wrap: break-word; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile--art:hover img { transform: none; }
  .btn:hover .icon, .tile:hover .tile__arrow { transform: none; }
}
