:root {
  --cobalt: #2c46e8;
  --cobalt-deep: #1f33b8;
  --paper: #f3f4f8;
  --card: #ffffff;
  --ink: #1c1d26;
  --mute: #5b5e70;
  --line: #d9dce6;
  --sun: #ffc83d;
  --pink: #ff9ac8;
  --mint: #4fd1a1;
  --sky: #9ec5ff;
  --display: "Unbounded", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;
  --bg: var(--paper);
  --bg-alt: #e8eaf2;
  --text: var(--ink);
  --text-muted: var(--mute);
  --border: var(--line);
  --accent: var(--sun);
  --accent2: var(--pink);
  --radius: 18px;
  --font-display: var(--display);
  --font-body: var(--body);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14151c;
    --card: #1e2029;
    --ink: #ecedf3;
    --mute: #a3a6b8;
    --line: #30323f;
    --cobalt: #3550f0;
    --bg-alt: #191b23;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

body::selection { background: var(--sun); color: #1c1d26; }

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

a { color: inherit; }

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

.container {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

section { padding: clamp(4rem, 9vw, 7rem) 0; }

h1, h2, h3, h4, .brand {
  color: inherit;
  font-family: var(--display);
  letter-spacing: -.025em;
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 100;
  height: auto;
  background: transparent;
  border: 0;
  transition: background .2s ease, box-shadow .2s ease;
}

.site-header.scrolled {
  position: fixed;
  background: color-mix(in srgb, var(--cobalt) 94%, transparent);
  border: 0;
  box-shadow: 0 10px 35px rgba(12, 18, 72, .16);
  backdrop-filter: blur(16px);
}

.nav-bar {
  min-height: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand span { color: var(--sun); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: #fff;
  font: 700 .96rem var(--body);
  text-decoration: none;
  opacity: .86;
  transition: opacity .2s ease;
}

.nav-links a::after { display: none; }
.nav-links a:hover, .nav-links a.active { color: #fff; opacity: 1; }
.nav-links a.active { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 7px; }

.nav-toggle { border-color: rgba(255, 255, 255, .55); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { background: #fff; }

.page-hero {
  position: relative;
  min-height: min(680px, 78svh);
  padding: clamp(9rem, 17vw, 13rem) 0 clamp(6rem, 12vw, 10rem);
  overflow: hidden;
  display: grid;
  align-items: center;
  text-align: left;
  color: #fff;
  background: var(--cobalt);
}

.page-hero::before {
  content: "";
  position: absolute;
  width: min(56vw, 680px);
  aspect-ratio: 1;
  right: -14vw;
  top: -26vw;
  border: clamp(3rem, 8vw, 7rem) solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1.4rem;
  background: linear-gradient(90deg, var(--sun) 0 25%, var(--pink) 25% 50%, var(--mint) 50% 75%, var(--sky) 75%);
  opacity: 1;
}

.page-hero .container { position: relative; z-index: 1; }

.page-hero h1 {
  max-width: 12ch;
  margin: 0;
  color: #fff;
  font: 800 clamp(2.9rem, 7.5vw, 6.8rem)/.98 var(--display);
  letter-spacing: -.045em;
}

.page-hero p:not(.eyebrow) {
  max-width: 38ch;
  margin: 1.5rem 0 0;
  color: #e4e8ff;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.page-hero .eyebrow {
  justify-content: flex-start !important;
  margin: 0 0 1rem;
  color: var(--sun);
  font: 700 .88rem var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.page-hero .grad-text { color: var(--sun); background: none; -webkit-text-fill-color: currentColor; }

.hero-stickers {
  position: absolute;
  right: clamp(1.25rem, 5vw, 4rem);
  bottom: clamp(3.5rem, 8vw, 6rem);
  width: min(38vw, 28rem);
  min-height: 13rem;
  pointer-events: none;
}

.hero-stickers span {
  position: absolute;
  display: inline-block;
  padding: .8rem 1.1rem;
  border-radius: 14px;
  color: #1c1d26;
  background: #fff;
  box-shadow: 0 4px 0 rgba(10, 16, 70, .3);
  font: 700 clamp(.78rem, 1.3vw, 1.05rem) var(--display);
  white-space: nowrap;
}

.hero-stickers span:nth-child(1) { top: 0; right: 1rem; background: var(--sun); transform: rotate(5deg); }
.hero-stickers span:nth-child(2) { top: 4.6rem; left: 0; background: var(--mint); transform: rotate(-7deg); }
.hero-stickers span:nth-child(3) { right: 0; bottom: 0; background: var(--pink); transform: rotate(2deg); }

.filters {
  position: sticky;
  z-index: 20;
  top: 5.75rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  padding: .5rem;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 18px 45px -30px rgba(20, 25, 80, .4);
  backdrop-filter: blur(14px);
}

.filters button {
  flex: 0 0 auto;
  padding: .65rem 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font: 700 .95rem var(--body);
  letter-spacing: 0;
  text-transform: none;
}

.filters button:hover { color: var(--cobalt); border-color: transparent; }
.filters button.active { color: #1c1d26; background: var(--sun); border-color: var(--sun); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}

.work-card {
  grid-column: span 4;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 55px -38px rgba(20, 25, 80, .5);
  cursor: pointer;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
}

.work-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 6px;
  background: var(--sun);
}

.work-card:nth-child(4n + 2)::before { background: var(--pink); }
.work-card:nth-child(4n + 3)::before { background: var(--mint); }
.work-card:nth-child(4n + 4)::before { background: var(--sky); }
.work-card:hover { transform: translateY(-8px) rotate(-.35deg); box-shadow: 0 34px 65px -38px rgba(20, 25, 80, .65); border-color: var(--ink); }
.work-card.hidden { display: none; }

.work-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  background: #050816;
  border-color: rgba(158, 197, 255, .4);
  box-shadow: 0 34px 80px -40px rgba(20, 73, 190, .85);
}

.work-card.featured::before {
  height: 8px;
  background: linear-gradient(90deg, #04b9ff, var(--sky), var(--mint));
}

.work-card.featured::after {
  content: "Biggest build yet";
  position: absolute;
  z-index: 3;
  top: 1.4rem;
  right: 1.4rem;
  padding: .7rem 1rem;
  color: #1c1d26;
  background: var(--sun);
  border-radius: 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  font: 700 .82rem var(--display);
  transform: rotate(3deg);
}

.work-card.featured .work-thumb {
  min-height: 0;
  aspect-ratio: 3 / 1;
  background: #02050e;
}

.work-card.featured .work-thumb img { object-fit: cover; object-position: center; }

.work-card.featured .work-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 18rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(39, 141, 255, .22), transparent 48%), #050816;
}

.work-card.featured .work-body h3 {
  margin: .65rem 0 1rem;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
}

.work-card.featured .work-body p {
  margin: 0 0 1.5rem;
  color: #cbd8f8;
  font-size: 1.08rem;
}

.work-card.featured .work-tag { color: var(--sky); }

.featured-kicker {
  color: var(--mint);
  font: 700 .8rem var(--display);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.work-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.work-card:hover .work-thumb img { transform: scale(1.045); }

.work-body { padding: 1.25rem 1.35rem 1.45rem; }
.work-body h3 { margin: 0 0 .6rem; color: var(--ink); font: 700 1.05rem/1.3 var(--display); }
.work-tag { display: inline-block; color: var(--mute); font: 700 .82rem var(--body); letter-spacing: 0; text-transform: none; }

.section-head { max-width: 760px; margin: 0 auto 3rem; }
.section-head h2 { margin: 0 0 .75rem; color: var(--ink); font: 800 clamp(2rem, 5vw, 3.6rem)/1.05 var(--display); letter-spacing: -.035em; }
.section-head p { color: var(--mute); font-size: 1.15rem; }
.section-head .eyebrow { color: var(--cobalt); font: 700 .9rem var(--display); letter-spacing: .04em; }

#writing { background: var(--bg-alt) !important; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.gallery-item {
  grid-column: span 4;
  margin: 0;
  padding: .75rem .75rem 1.25rem;
  overflow: visible;
  background: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 20px 38px -22px rgba(20, 25, 80, .55);
  cursor: zoom-in;
  transform: rotate(-1.5deg);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item:nth-child(3n + 2) { transform: rotate(1.2deg); }
.gallery-item:nth-child(3n) { transform: rotate(-.4deg); }
.gallery-item:hover { transform: translateY(-10px) rotate(0); box-shadow: 0 32px 48px -24px rgba(20, 25, 80, .62); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: filter .25s ease; }
.gallery-item:hover img { transform: none; filter: saturate(1.08); }
.gallery-item figcaption {
  position: static;
  padding: .9rem .35rem 0;
  color: #1c1d26;
  background: transparent;
  opacity: 1;
  transform: none;
  font: 700 .95rem var(--display);
  text-align: center;
}

.modal { z-index: 1000; padding: 1.25rem; }
.modal-backdrop { background: rgba(14, 16, 28, .82); backdrop-filter: blur(10px); }
.modal-card { max-width: 820px; overflow: hidden; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 35px 100px rgba(0, 0, 0, .35); }
.modal-card img { width: 100%; max-height: 60vh; object-fit: cover; }
.modal-body { padding: clamp(1.25rem, 4vw, 2rem); }
.modal-body h3 { margin: 0 0 .75rem; color: var(--ink); font: 700 clamp(1.2rem, 3vw, 1.75rem)/1.2 var(--display); }
.modal-body p { color: var(--mute); }
.modal-cat { color: var(--cobalt); font: 700 .88rem var(--body); letter-spacing: 0; text-transform: none; }
.modal-close { top: .8rem; right: .8rem; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; color: #1c1d26; background: var(--sun); border: 0; border-radius: 50%; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.modal-close:hover { color: #1c1d26; background: var(--pink); }

.btn {
  display: inline-block;
  padding: .8rem 1.3rem;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font: 700 1rem var(--body);
  text-decoration: none;
}

.btn-primary { color: #fff; background: var(--cobalt); border-color: var(--cobalt); box-shadow: none; }
.btn:hover, .btn-primary:hover { color: #fff; background: var(--cobalt-deep); border-color: var(--cobalt-deep); transform: none; box-shadow: none; }

.site-footer { padding: 2rem 0 2.5rem; color: var(--mute); background: var(--paper); border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-social { display: flex; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.hero-social a, .footer-social a { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 50%; }
.hero-social a:hover, .footer-social a:hover { color: #fff; background: var(--cobalt); border-color: var(--cobalt); transform: none; }

#to-top { right: 1.25rem; bottom: 1.25rem; display: grid; place-items: center; width: 3rem; height: 3rem; color: #fff; background: var(--cobalt); border: 0; border-radius: 50%; box-shadow: 0 8px 22px rgba(31, 51, 184, .28); }
#to-top:hover { transform: translateY(-3px); border-color: transparent; }

.reveal { transform: translateY(20px); }
.reveal.in { transform: none; }

@media (max-width: 900px) {
  .hero-stickers { opacity: .72; right: -2.5rem; bottom: 3.5rem; }
  .work-card, .gallery-item { grid-column: span 6; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    background: var(--cobalt-deep);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.nav-open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-links a { font: 700 1.15rem var(--display); }
  .page-hero { min-height: 640px; padding-top: 9rem; align-items: start; }
  .page-hero h1 { max-width: 11ch; font-size: clamp(2.7rem, 14vw, 5rem); }
  .hero-stickers { position: relative; inset: auto; width: 100%; min-height: 12rem; margin-top: 3rem; opacity: 1; }
  .filters { top: 5.25rem; margin-inline: 0; border-radius: 16px; }
  .work-card, .gallery-item { grid-column: 1 / -1; }
  .work-card.featured .work-thumb { aspect-ratio: 3 / 1; }
  .work-card.featured .work-body { min-height: 0; padding: 1.6rem 1.35rem 1.8rem; }
  .work-card.featured::after { top: 1rem; right: 1rem; font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
