:root {
  --paper: #f3f0e7;
  --card: #fbf9f2;
  --ink: #191813;
  --muted: #6e6a5c;
  --hairline: rgba(25, 24, 19, 0.18);
  --blue: #1f2de6;
  --orange: #ff4d00;
  --yellow: #ffd84d;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Archivo", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Archivo", sans-serif;
  --cream: #f3f0e7;
  --grid-line: rgba(25, 24, 19, 0.09);
  --shadow: rgba(25, 24, 19, 0.12);
  --shadow-h: rgba(25, 24, 19, 0.16);
  --bar-bg: rgba(243, 240, 231, 0.94);
  --warp-dir: 1;
}

[data-theme="dark"] {
  --paper: #14130f;
  --card: #1e1c16;
  --ink: #f3f0e7;
  --muted: #a49f8f;
  --hairline: rgba(243, 240, 231, 0.2);
  --blue: #7c83ff;
  --grid-line: rgba(243, 240, 231, 0.1);
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-h: rgba(0, 0, 0, 0.62);
  --bar-bg: rgba(20, 19, 15, 0.9);
  --warp-dir: -0.4;
}


* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  line-height: 1.6;
}

body.live-bg { background-image: none; }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: none;
}

body.live-bg #bg { display: block; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

main, footer { position: relative; z-index: 1; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 28px;
  background: var(--bar-bg);
  border-bottom: 1.5px solid var(--ink);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand sup { font-size: 9px; vertical-align: super; }

.topbar nav { display: flex; gap: 4px; align-items: center; }

.topbar nav a {
  font-family: var(--mono);
  text-decoration: none;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 11px;
}

.topbar nav a:hover { color: var(--blue); }

.topbar nav a.active {
  color: var(--paper);
  background: var(--ink);
}

.theme-toggle {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 5px 10px;
  margin-left: 8px;
  cursor: pointer;
}

.theme-toggle:hover { background: var(--ink); color: var(--paper); }

/* ---------- cover (home) ---------- */

.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 6vw 0;
  overflow: hidden;
}

.cover-text {
  position: relative;
  z-index: 1;
  max-width: 52%;
}

.cover-photo {
  position: absolute;
  right: 3vw;
  bottom: 0;
  top: 40px;
  width: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

.cover-photo-note {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
  z-index: 2;
}

.cat-no {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 22px;
}

.cover h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 6.4vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hl {
  display: inline;
  background: var(--blue);
  color: var(--cream);
  padding: 0.05em 0.16em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}


.cover-sub {
  margin-top: 28px;
  max-width: 560px;
  font-size: 17px;
  color: var(--muted);
}

.aside {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  padding: 12px 20px;
  cursor: pointer;
}

.btn:hover { background: var(--paper); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 rgba(31, 45, 230, 0.25);
}

.btn-primary:hover { background: var(--blue); color: var(--cream); }

/* stickers */

.sticker {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 3px 3px 0 rgba(25, 24, 19, 0.2);
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 5;
}

.sticker:active { cursor: grabbing; }

.st-blue { background: var(--blue); color: var(--paper); }
.st-orange { background: var(--orange); color: var(--paper); }
.st-yellow { background: var(--yellow); color: var(--ink); }

/* ---------- ticker ---------- */

.ticker {
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  background: var(--card);
  overflow: hidden;
  padding: 9px 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  animation: tick 22s linear infinite;
}

@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.dept { padding: 84px 6vw 24px; }

.page-top { padding-top: 130px; min-height: 80svh; }

.dept-head {
  display: flex;
  align-items: baseline;
  gap: 22px;
  flex-wrap: wrap;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 34px;
}

.dept-no {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.dept-head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.dept-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- proof points (home) ---------- */

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.proof {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 22px 24px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.proof:hover { box-shadow: 10px 10px 0 var(--shadow-h); }

.proof-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.proof-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  margin: 10px 0 8px;
}

.proof-label { font-size: 14px; color: var(--muted); }

.home-close { max-width: 620px; font-size: 16px; color: var(--muted); }

.home-close a { color: var(--blue); }

/* ---------- shared card bits ---------- */

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.entry-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--blue);
  text-transform: uppercase;
}

.tag-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  border: 1px solid currentColor;
  padding: 2px 8px;
}

.tag-pill.live { color: var(--blue); text-decoration: none; }
.tag-pill.live:hover { background: var(--blue); color: var(--cream); }

.media-note {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 4px 10px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin-top: 16px;
}

.chips li {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  background: var(--paper);
}

.stat {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  color: var(--blue);
}

.s-orange { color: var(--orange); }

/* ---------- filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }

.filter {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 8px 16px;
  cursor: pointer;
}

.filter:hover { background: var(--paper); }

.filter.active { background: var(--ink); color: var(--paper); }

/* ---------- case studies (work) ---------- */

.cs-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 940px;
}

.cs {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.cs:hover { box-shadow: 10px 10px 0 var(--shadow-h); }

.cs.hidden { display: none; }

.cs-media {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  border-right: 1.5px solid var(--ink);
  background: repeating-linear-gradient(
    -45deg,
    var(--card),
    var(--card) 10px,
    var(--hairline) 10px,
    var(--hairline) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.shot.loaded { opacity: 1; }

.shot.contain { object-fit: contain; background: var(--card); }

/* ---------- certs ---------- */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  max-width: 940px;
}

.cert {
  margin: 0;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
}

.cert-media {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border-bottom: 1.5px solid var(--ink);
  background: repeating-linear-gradient(
    -45deg,
    var(--card),
    var(--card) 10px,
    var(--hairline) 10px,
    var(--hairline) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.cert figcaption { padding: 14px 16px 16px; }

.cert-name { font-family: var(--display); font-weight: 700; font-size: 16px; }

.cert-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

.cs-body { padding: 22px 26px 26px; }

.cs h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.cs-rows { margin: 0; }

.cs-rows > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}

.cs-rows dt {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 3px;
}

.cs-rows dd { margin: 0; font-size: 14px; color: var(--muted); }

.cs-rows dd.stat { color: var(--blue); }

.cs-rows dd.s-orange { color: var(--orange); }

.cs-redacted .cs-media { background: var(--ink); }
.cs-redacted .media-note { background: var(--ink); color: var(--paper); border-color: rgba(251, 249, 242, 0.3); }

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

.about-intro {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1040px;
  margin-bottom: 0;
}

.about-photo {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.about-sidebar {
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 24px 26px;
}

.about-sidebar h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

.about-prose {
  max-width: 720px;
}

.prose p { font-size: 16.5px; color: var(--muted); }

.prose p + p { margin-top: 16px; }

.prose a { color: var(--blue); }

.color-box h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

.color-list { list-style: none; padding: 0; }

.color-list li {
  padding: 11px 0;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--muted);
}

.color-list li span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 2px;
}

.color-list a { color: var(--blue); }

/* ---------- resume ---------- */

.resume {
  max-width: 780px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 38px 44px;
}

.r-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.r-head h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
}

.r-head > div > p { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }

.r-contact { list-style: none; padding: 0; text-align: right; }

.r-contact li { font-family: var(--mono); font-size: 12px; }

.r-contact a { color: var(--blue); text-decoration: none; }

.r-sec { margin-top: 22px; }

.r-sec h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.r-item + .r-item { margin-top: 14px; }

.r-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 15px;
}

.r-item-head span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.r-item ul { margin: 6px 0 0; padding-left: 18px; }

.r-item li { font-size: 13.5px; color: var(--muted); }

.r-chips { margin-top: 4px; }

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

footer { padding: 90px 6vw 34px; overflow: hidden; }

.footer-small { padding-top: 40px; }

.footer-giant {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(80px, 17vw, 260px);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  opacity: 0.55;
  user-select: none;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1.5px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.footer-small .footer-row { margin-top: 0; }

.footer-row a { color: var(--blue); text-decoration: none; }

/* ---------- reveal ---------- */

.dept, .ticker { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }

.dept.in-view, .ticker.in-view { opacity: 1; transform: none; }

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

@media (max-width: 760px) {
  /* nav */
  .topbar { padding: 10px 12px; }
  .topbar nav { gap: 0; flex-wrap: wrap; justify-content: flex-end; }
  .topbar nav a { font-size: 10px; padding: 5px 6px; }
  .brand { font-size: 15px; }
  .theme-toggle { font-size: 9px; padding: 4px 8px; margin-left: 4px; }

  /* hero */
  .cover { min-height: 100svh; padding: 110px 5vw 40px; justify-content: center; }
  .cover-text { max-width: 100%; }
  .cover-photo { display: none; }
  .cover h1 { font-size: clamp(56px, 16vw, 80px); line-height: 1.05; }
  .cover-sub { font-size: 17px; line-height: 1.55; margin-top: 20px; }
  .cta-row { gap: 8px; margin-top: 28px; }
  .btn { font-size: 12px; padding: 12px 20px; }

  /* sections */
  .dept { padding: 50px 5vw 10px; }
  .page-top { padding-top: 100px; }
  .dept-head h2 { font-size: clamp(30px, 9vw, 44px); }
  .dept-tag { margin-left: 0; }

  /* proof cards (home) */
  .proof-grid { grid-template-columns: 1fr; gap: 14px; }

  /* work cards */
  .cs { grid-template-columns: 1fr; }
  .cs-media { border-right: none; border-bottom: 1.5px solid var(--ink); min-height: 160px; aspect-ratio: 16 / 9; }
  .cs-body { padding: 16px 18px 20px; }

  /* certs */
  .cert-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* about */
  .about-intro { grid-template-columns: 1fr; gap: 22px; }
  .about-photo img { aspect-ratio: 1 / 1; }
  .prose p { font-size: 15px; }

  /* resume */
  .resume { padding: 22px 16px; }
  .r-head { flex-direction: column; gap: 8px; }
  .r-contact { text-align: left; }
  .r-item-head { flex-direction: column; gap: 2px; }
  .r-item-head span { text-align: left; }

  /* footer */
  .footer-row { flex-direction: column; gap: 8px; text-align: center; }
  footer { padding: 40px 5vw 24px; }

  /* misc */
  .sticker { position: static; display: inline-block; align-self: flex-start; width: max-content; margin: 14px 10px 0 0; }
  .cs-rows > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 420px) {
  .topbar nav a { font-size: 9px; padding: 4px 5px; }
  .brand { font-size: 14px; }
  .cover h1 { font-size: clamp(52px, 15vw, 72px); }
  .cert-grid { grid-template-columns: 1fr; }
  .chips { gap: 5px; }
  .chips li { font-size: 10px; padding: 3px 8px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .cs, .proof { transition: none; }
  .shot { transition: none; }
  .dept, .ticker { transition: none; opacity: 1; transform: none; }
}

/* ---------- print (resume) ---------- */

@media print {
  body { background: #fff; }
  body::after, #bg, .topbar, .footer-small, .dept-head, .aside, .tag-pill { display: none !important; }
  .dept, .page-top { padding: 0; min-height: 0; opacity: 1; transform: none; }
  .resume { border: none; box-shadow: none; max-width: none; padding: 0; background: #fff; }
}
