/* ============================================================
   ATARIUS ARMSTRONG — portfolio
   Dark / cinematic base · teal haze · cream + forest accents
   ============================================================ */

:root {
  --ink: #0a0c0b;
  --ink-2: #101413;
  --cream: #e9e2d2;
  --cream-dim: rgba(233, 226, 210, 0.55);
  --cream-faint: rgba(233, 226, 210, 0.28);
  --teal: #17383e;
  --forest: #33493c;
  --sage: #8aa392;
  --line: rgba(233, 226, 210, 0.14);

  --font-display: 'Syne', sans-serif;
  --font-serif: 'DM Serif Display', serif;
  --font-body: 'Montserrat', sans-serif;
}

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

html {
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--forest);
  color: var(--cream);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- atmosphere layers ---------- */

.haze {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 18%, rgba(23, 56, 62, 0.55), transparent 70%),
    radial-gradient(50% 45% at 12% 78%, rgba(51, 73, 60, 0.30), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, rgba(10, 20, 22, 0.9), transparent 70%);
}

#ball-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1; /* behind page content; shows through the transparent gutters */
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -100px;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.8s steps(6) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-30px, 20px); }
  40% { transform: translate(20px, -35px); }
  60% { transform: translate(-25px, -15px); }
  80% { transform: translate(30px, 25px); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(4, 6, 5, 0.55) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

/* ---------- nav ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  mix-blend-mode: difference;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
}
.wordmark span {
  /* font-weight: 400; */
  color: var(--cream-dim);
}

.site-nav nav {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.6rem);
}

.nav-link {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.3s;
}
.nav-link:hover {
  color: var(--cream);
}

/* ---------- shared layout ---------- */

main {
  position: relative;
  z-index: 10;
}

.section {
  position: relative;
  padding: clamp(6rem, 14vh, 11rem) clamp(1.2rem, 5vw, 4rem);
  max-width: 100rem;
  margin: 0 auto;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-label .idx {
  color: var(--cream-faint);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(1.2rem, 5vw, 4rem);
  overflow: hidden;
}

/* Texture source for the hero WebGL wave — never seen directly; the wave on
   the canvas is the visible hero. Browsers pause videos that are hidden or
   fully occluded, so we keep a tiny, near-transparent, un-occluded sliver on
   top: enough for the decoder to keep feeding fresh frames to the texture. */
.hero-video {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  opacity: 0.01;
  z-index: 100;
  pointer-events: none;
  object-fit: cover;
}

.hero-wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 12, 11, 0.55) 0%, rgba(10, 12, 11, 0.25) 45%, var(--ink) 98%),
    radial-gradient(70% 60% at 70% 40%, rgba(23, 56, 62, 0.35), transparent 75%);
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 2.2rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 6.5vw, 10.5rem);
  line-height: 0.94;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  max-width: 12ch;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--cream);
}

.hero-tag {
  margin-top: 2.4rem;
  max-width: 34ch;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--cream-dim);
}

.hero-foot {
  position: absolute;
  bottom: 2rem;
  left: clamp(1.2rem, 5vw, 4rem);
  right: clamp(1.2rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-faint);
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.about-copy {
  grid-column: 1 / span 7;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  line-height: 1.45;
  color: var(--cream);
}
.about-copy .accent {
  color: var(--sage);
  font-style: italic;
}

.about-figure {
  grid-column: 9 / span 4;
  margin-top: clamp(3rem, 10vh, 7rem);
}
.about-media {
  overflow: hidden;
}
.about-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(0.35) brightness(0.85) contrast(1.05);
  scale: 1.16;
}
.about-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-faint);
}

/* ---------- capabilities ---------- */

.cap-list {
  display: flex;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  row-gap: clamp(3rem, 8vh, 6rem);
}

.cap-card {
  /* border-top: 1px solid var(--line); */
  padding-top: 1.6rem;
}
/* .cap-card:nth-child(1) { grid-column: 1 / span 4; }
.cap-card:nth-child(2) { grid-column: 6 / span 4; margin-top: clamp(2rem, 8vh, 6rem); }
.cap-card:nth-child(3) { grid-column: 9 / span 4; margin-top: clamp(4rem, 16vh, 12rem); } */

.cap-card .idx {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--sage);
}

.cap-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 1rem 0 0.9rem;
  line-height: 1.25;
}

.cap-card p {
  font-size: 0.9rem;
  color: var(--cream-dim);
}

/* ---------- works ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  row-gap: clamp(4rem, 10vh, 8rem);
}

.work {
  position: relative;
  display: block;
}
.work:nth-child(8n + 1) { grid-column: 1 / span 6; }
.work:nth-child(8n + 2) { grid-column: 8 / span 5; margin-top: clamp(4rem, 14vh, 10rem); }
.work:nth-child(8n + 3) { grid-column: 2 / span 4; }
.work:nth-child(8n + 4) { grid-column: 7 / span 6; margin-top: clamp(3rem, 10vh, 7rem); }
.work:nth-child(8n + 5) { grid-column: 1 / span 5; }
.work:nth-child(8n + 6) { grid-column: 7 / span 4; margin-top: clamp(4rem, 14vh, 10rem); }
.work:nth-child(8n + 7) { grid-column: 3 / span 6; }
.work:nth-child(8n + 8) { grid-column: 9 / span 4; margin-top: clamp(2rem, 8vh, 6rem); }

.work-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.work:nth-child(8n + 2) .work-media,
.work:nth-child(8n + 6) .work-media { aspect-ratio: 3 / 4; }

/* `scale` is kept separate from `transform` so GSAP's parallax translate
   and the hover zoom never fight; the base scale is parallax headroom. */
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.4) brightness(0.8) contrast(1.05);
  scale: 1.18;
  transition: filter 0.6s ease, scale 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.work:hover .work-media img {
  filter: grayscale(0) brightness(0.95) contrast(1.02);
  scale: 1.1;
}

.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  gap: 1rem;
}

.work-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.work-idx {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--cream-faint);
  white-space: nowrap;
}

/* ---------- reel ---------- */

.reel-frame {
  grid-column: 1 / -1;
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 62rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  padding: clamp(0.5rem, 1.4vw, 1rem);
  background: rgba(233, 226, 210, 0.02);
}
.reel-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: saturate(0.85);
}

/* ---------- contact / footer ---------- */

.contact {
  text-align: center;
  padding-bottom: 4rem;
}

.contact h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 13vw, 12rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.015em;
}

.contact h2 a {
  transition: color 0.4s;
}
.contact h2 a:hover {
  color: var(--sage);
}

.contact .sub {
  margin-top: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 2.4rem clamp(1.2rem, 5vw, 4rem) 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-faint);
}
.site-footer a:hover {
  color: var(--cream);
}

/* ---------- reveal defaults (GSAP takes over) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .about-copy { grid-column: 1 / -1; }
  .about-figure { grid-column: 3 / -1; margin-top: 2rem; }

  .cap-card:nth-child(n) {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .work:nth-child(n) {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .work:nth-child(even) {
    grid-column: 2 / -1;
  }
}

/* ============================================================
   Design portfolio — row list (distinct from the scattered grid)
   ============================================================ */

.design-list {
  border-top: 1px solid var(--line);
}

.design-row {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: center;
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: padding 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s;
}
.design-row:hover {
  padding-left: 1.4rem;
  padding-right: 1.4rem;
  background: rgba(233, 226, 210, 0.03);
}

.design-row-media {
  width: 128px;
  height: 82px;
  overflow: hidden;
}
.design-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.4) brightness(0.82) contrast(1.05);
  transition: filter 0.5s ease, scale 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  scale: 1.05;
}
.design-row:hover .design-row-media img {
  filter: none;
  scale: 1;
}

.design-row-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(1.15rem, 2.1vw, 1.7rem);
  line-height: 1.15;
}
.design-row-meta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}
.design-row-year {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--cream-faint);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .design-row {
    grid-template-columns: 92px 1fr;
    gap: 1.2rem;
  }
  .design-row-media { width: 92px; height: 64px; }
  .design-row-year { display: none; }
}

/* ============================================================
   Case-study (project) pages
   ============================================================ */

.project {
  position: relative;
  z-index: 10;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(7rem, 16vh, 11rem) clamp(1.2rem, 5vw, 4rem) clamp(5rem, 12vh, 8rem);
}

.project-back {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
  transition: color 0.3s;
}
.project-back:hover { color: var(--cream); }

.project-head {
  margin: 2rem 0 3rem;
}
.project-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.2rem;
}
.project-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.4rem;
  margin-top: 1.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
}
.project-meta em {
  display: block;
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: 0.3rem;
}
.project-meta a { color: var(--sage); }
.project-meta a:hover { color: var(--cream); }

.project-cover {
  overflow: hidden;
  margin-bottom: clamp(2rem, 6vh, 4rem);
}
.project-cover img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-body {
  margin: 0 auto;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--cream-dim);
}
.project-body p { margin-bottom: 1.4rem; }
.project-body h2,
.project-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cream);
  margin: 2.4rem 0 1rem;
  font-size: 1.2rem;
}
.project-body a { color: var(--sage); text-decoration: underline; }
.project-body em { color: var(--cream-faint); }

.project-reel { margin: clamp(2.5rem, 7vh, 4.5rem) 0; }

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: clamp(2.5rem, 7vh, 4.5rem) 0;
}
.project-gallery img {
  width: 100%;
  object-fit: cover;
}
@media (max-width: 640px) {
  .project-gallery { grid-template-columns: 1fr; }
}

.project-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3rem, 9vh, 6rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.project-pager-link {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--cream-dim);
  transition: color 0.3s;
  max-width: 45%;
}
.project-pager-link:hover { color: var(--cream); }
