/* =====================================================================
   PORTFOLIO TEMPLATE 2 — bold editorial / neo-brutalist
   ---------------------------------------------------------------------
   CONFIG — edit colors, fonts and sizes here. Nothing else needs to change.
   Switch palette with <html data-theme="dark"> or data-theme="cream".
   ===================================================================== */
:root {
  /* ---- Fonts (also update the Google Fonts <link> in index.html) ---- */
  --font-display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* ---- Layout ---- */
  --pad: clamp(1rem, 3vw, 2.5rem);   /* page side padding */
  --border: 3px;                     /* the thick border */
  --header-h: 64px;                  /* fixed header height */

  /* ---- Palette: DARK (default) ---- */
  --bg: #0e0e0e;          /* page background */
  --bg-alt: #181818;      /* panels / placeholders */
  --ink: #f4f4ef;         /* main text */
  --muted: #a9a9a0;       /* secondary text */
  --line: #f4f4ef;        /* borders */
  --accent: #d4ff3a;      /* the one loud color */
  --on-accent: #0e0e0e;   /* text that sits ON the accent color */
}
[data-theme="cream"] {
  /* ---- Palette: CREAM + black + one red ---- */
  --bg: #f1ece2;
  --bg-alt: #e5dfd2;
  --ink: #0e0e0e;
  --muted: #4d4a44;
  --line: #0e0e0e;
  --accent: #c8141b;
  --on-accent: #ffffff;
}
/* ===================== END CONFIG ===================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-mono); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
.mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; font-size: .8125rem; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Focus + skip link ---------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.section-accent :focus-visible, .marquee :focus-visible, .btn:focus-visible { outline-color: var(--ink); }
.btn:focus-visible { outline-offset: 4px; box-shadow: 0 0 0 3px var(--bg); }
.skip {
  position: fixed; left: var(--pad); top: -100px; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: .75rem 1rem;
  font-weight: 700; text-decoration: none; border: var(--border) solid var(--line);
}
.skip:focus { top: .75rem; }

/* ---------- Shared bits ---------- */
.dot { display: inline-block; width: .6rem; height: .6rem; background: var(--accent); margin-right: .4rem; animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: .9rem 1.4rem;
  background: var(--accent); color: var(--on-accent); border: var(--border) solid var(--line);
  font-family: var(--font-mono); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; box-shadow: 5px 5px 0 var(--line);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--line); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad); background: var(--bg); border-bottom: var(--border) solid var(--line);
}
.logo { font-family: var(--font-display); font-size: 1.5rem; text-decoration: none; letter-spacing: -.02em; justify-self: start; }
.logo-dot { color: var(--accent); }
.header-status { justify-self: center; }
.menu-toggle {
  justify-self: end; display: inline-flex; align-items: center; gap: .75rem; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: var(--border) solid var(--line);
  padding: .5rem .9rem; font: 700 .8125rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
}
.menu-toggle:hover { background: var(--ink); color: var(--bg); }
.menu-toggle-icon { display: grid; gap: 5px; width: 20px; }
.menu-toggle-icon i { display: block; height: 3px; background: currentColor; }

/* ---------- Fullscreen menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 100; background: var(--accent); color: var(--on-accent);
  display: flex; flex-direction: column; padding: 0 var(--pad) var(--pad);
  visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path .5s cubic-bezier(.7,0,.2,1), visibility 0s .5s;
}
.menu.is-open { visibility: visible; clip-path: inset(0); transition: clip-path .5s cubic-bezier(.7,0,.2,1), visibility 0s; }
.menu-bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; border-bottom: var(--border) solid var(--on-accent); }
.menu-close {
  cursor: pointer; background: var(--on-accent); color: var(--accent); border: var(--border) solid var(--on-accent);
  padding: .5rem .9rem; font: 700 .8125rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
}
.menu-close:hover { background: transparent; color: var(--on-accent); }
.menu :focus-visible { outline-color: var(--on-accent); }
.menu-list { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.menu-list a {
  display: flex; align-items: baseline; gap: 1.25rem; text-decoration: none;
  font-family: var(--font-display); font-size: clamp(2.75rem, 10vw, 8rem); line-height: 1.05; text-transform: uppercase;
  letter-spacing: -.03em; padding: .1em 0; border-bottom: var(--border) solid transparent;
  transition: padding-left .2s, background .2s, color .2s;
}
.menu-list a .mono { font-size: .875rem; letter-spacing: .05em; }
.menu-list a:hover, .menu-list a:focus-visible { padding-left: 1.5rem; background: var(--on-accent); color: var(--accent); outline-offset: -3px; }
.menu-foot a { font-weight: 700; }

/* ---------- Hero ---------- */
main { padding-top: var(--header-h); }
.hero {
  position: relative; min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column;
  padding: 1.25rem var(--pad) var(--pad); overflow: hidden;
}
.hero-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; border: var(--border) solid var(--line); padding: .35rem .75rem;
  font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.name {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(4.25rem, 19.5vw, 27rem); line-height: .82; letter-spacing: -.05em;
  margin: auto 0 0; padding-top: 2rem; margin-left: -.04em;
  animation: rise .9s cubic-bezier(.2,.8,.2,1) both;
}
.name-line { display: block; }
.name-line-2 { padding-left: 12vw; color: var(--accent); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sticker {
  position: absolute; right: calc(var(--pad) + 1vw); top: 22%; width: clamp(96px, 11vw, 168px); aspect-ratio: 1;
  display: grid; place-items: center; text-align: center; background: var(--accent); color: var(--on-accent);
  border: var(--border) solid var(--line); font: 700 clamp(.65rem, .9vw, .875rem)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
  transform: rotate(10deg); box-shadow: 6px 6px 0 var(--line);
  animation: spin-in .9s .2s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes spin-in { from { transform: rotate(-40deg) scale(.4); opacity: 0; } }
.hero-bottom {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  border-top: var(--border) solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem;
}
.hero-intro { max-width: 52ch; margin-left: auto; color: var(--ink); font-size: 1rem; }
.hero-bottom .btn { order: -1; }

/* ---------- Marquee ---------- */
.marquee {
  background: var(--accent); color: var(--on-accent); overflow: hidden; white-space: nowrap;
  border-block: var(--border) solid var(--line); transform: rotate(-1.2deg) scale(1.03); margin: 1.5rem 0 2.5rem;
}
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee-group span { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(1.6rem, 4.2vw, 3.75rem); padding: .35em .5em; line-height: 1; }
.marquee-group .star { padding-inline: .15em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections + sticky labels ---------- */
.section { position: relative; scroll-margin-top: var(--header-h); }
.label {
  position: sticky; top: var(--header-h); z-index: 10; display: flex; align-items: baseline; gap: 1rem;
  background: var(--bg); border-block: var(--border) solid var(--line); padding: .35rem var(--pad);
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: -.035em;
  font-size: clamp(2.5rem, 9vw, 8.5rem); line-height: 1.05;
}
.label-n { font-size: .875rem; letter-spacing: .05em; color: var(--accent); }
.label-count { margin-left: auto; font-size: .875rem; color: var(--muted); letter-spacing: .05em; }
.section-accent { background: var(--accent); color: var(--on-accent); }
.section-accent .label { background: var(--accent); border-color: var(--on-accent); }
.section-accent .label-n, .section-accent .label-count { color: var(--on-accent); }
#about, #work, #clients, #contact, .testimonial { margin-top: 0; }

/* ---------- Work index ---------- */
.work-list { counter-reset: none; }
.work-row { border-bottom: var(--border) solid var(--line); position: relative; }
.work-link {
  position: relative; display: grid; grid-template-columns: 4rem 1fr 14rem 5rem; align-items: center; gap: 1rem;
  padding: clamp(1rem, 2.2vw, 1.75rem) var(--pad); text-decoration: none; transition: background .15s, color .15s, padding-left .25s;
}
.work-title { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(1.75rem, 4.5vw, 4.75rem); letter-spacing: -.035em; line-height: 1; }
.work-year { text-align: right; }
.work-num { color: var(--muted); }
.row-img { display: none; }
.ph {
  display: grid; place-content: center; text-align: center; width: 100%; height: 100%; min-height: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(128,128,128,.28) 14px 16px),
    var(--bg-alt);
  color: var(--ink); font-family: var(--font-mono);
}
.ph b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: -.02em; }
.ph small { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ph-tall { aspect-ratio: 4 / 5; }

@media (hover: hover) and (pointer: fine) and (min-width: 861px) {
  .work-link:hover, .work-link:focus-visible { background: var(--accent); color: var(--on-accent); padding-left: calc(var(--pad) + 1rem); outline-offset: -6px; }
  .work-link:hover .work-num, .work-link:focus-visible .work-num { color: var(--on-accent); }
  .work-link:focus-visible { outline-color: var(--on-accent); }
  .work-row:hover { z-index: 5; }
  .row-img {
    display: block; position: absolute; z-index: 20; pointer-events: none; width: clamp(240px, 24vw, 400px); aspect-ratio: 16 / 10;
    left: var(--x, 55%); top: var(--y, 50%); border: var(--border) solid var(--line); background: var(--bg-alt);
    opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(.85); transition: opacity .15s, transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: 8px 8px 0 var(--on-accent);
  }
  .work-link:hover .row-img, .work-link:focus-visible .row-img { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); }
  .row-img img { width: 100%; height: 100%; object-fit: cover; }
}
.work-more { padding: 2rem var(--pad); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.about-photo { border-right: var(--border) solid var(--line); padding: var(--pad); }
.about-photo .ph { border: var(--border) solid var(--line); box-shadow: 10px 10px 0 var(--accent); }
.about-photo figcaption { margin-top: 1.5rem; color: var(--muted); }
.about-body { padding: var(--pad); display: grid; gap: 1.5rem; align-content: start; }
.about-statement { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(1.6rem, 3.6vw, 3.5rem); line-height: 1.02; letter-spacing: -.03em; }
.about-text { max-width: 62ch; color: var(--ink); }
.facts { border-top: var(--border) solid var(--line); }
.facts > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); align-self: center; }
.facts dd { font-weight: 700; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); }
.service { position: relative; padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad) clamp(2rem, 4vw, 3.5rem); border-bottom: var(--border) solid var(--on-accent); display: grid; gap: .9rem; align-content: start; transition: background .15s, color .15s; }
.service:nth-child(odd) { border-right: var(--border) solid var(--on-accent); }
.service:hover { background: var(--on-accent); color: var(--accent); }
.service-num { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: var(--border) solid currentColor; font-weight: 700; }
.service-title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2rem, 4.6vw, 4.5rem); letter-spacing: -.035em; line-height: 1; }
.service-text { max-width: 44ch; }
.service-list { font-weight: 700; }

/* ---------- Clients ---------- */
.clients { display: grid; grid-template-columns: repeat(3, 1fr); }
.clients li { border-bottom: var(--border) solid var(--line); border-right: var(--border) solid var(--line); min-height: clamp(110px, 14vw, 180px); display: grid; place-items: center; }
.clients li:nth-child(3n) { border-right: 0; }
.clients li:nth-child(n+4) { border-bottom: var(--border) solid var(--line); }
.logo-ph { color: var(--muted); font-size: .875rem; }
.clients img { max-height: 44px; width: auto; }

/* ---------- Testimonial ---------- */
.testimonial { padding: clamp(3rem, 8vw, 8rem) var(--pad); border-bottom: var(--border) solid var(--line); }
.quote { position: relative; max-width: 1300px; margin-left: clamp(0rem, 6vw, 8rem); }
.quote-mark { position: absolute; left: -.1em; top: -.45em; font-family: var(--font-display); font-size: clamp(8rem, 24vw, 22rem); line-height: 1; color: var(--accent); pointer-events: none; }
.quote blockquote { position: relative; }
.quote p { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(1.6rem, 4.4vw, 4.25rem); line-height: 1.04; letter-spacing: -.03em; padding-top: clamp(2.5rem, 7vw, 6rem); }
.quote figcaption { margin-top: 2rem; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-inner { padding: clamp(2rem, 6vw, 5rem) var(--pad) clamp(2.5rem, 6vw, 5rem); }
.contact-lead { color: var(--muted); margin-bottom: 1rem; }
.mail {
  display: block; font-family: var(--font-display); text-decoration: none; letter-spacing: -.045em; line-height: 1;
  font-size: clamp(2rem, 9.2vw, 11rem); overflow-wrap: anywhere;
  border-bottom: .06em solid var(--accent); padding-bottom: .12em; transition: color .15s, background .15s;
}
.mail:hover { color: var(--on-accent); background: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.socials a {
  display: inline-block; padding: .75rem 1.25rem; border: var(--border) solid var(--line); text-decoration: none; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; transition: background .12s, color .12s, transform .12s;
}
.socials a:hover { background: var(--accent); color: var(--on-accent); transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--line); }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center;
  padding: 1.25rem var(--pad); border-top: var(--border) solid var(--line); background: var(--accent); color: var(--on-accent);
}
.site-footer :focus-visible { outline-color: var(--on-accent); }
.footer-clock span { font-weight: 700; font-variant-numeric: tabular-nums; }
.footer-copy { text-align: center; }
.to-top { justify-self: end; text-decoration: none; font-weight: 700; border: var(--border) solid var(--on-accent); padding: .45rem .9rem; }
.to-top:hover { background: var(--on-accent); color: var(--accent); }

/* ---------- Custom cursor (optional; JS enables it only on fine pointers + no reduced motion) ---------- */
.cursor { display: none; }
.has-cursor .cursor {
  display: block; position: fixed; left: 0; top: 0; z-index: 300; width: 22px; height: 22px; pointer-events: none;
  border: 3px solid var(--accent); mix-blend-mode: difference; transition: width .2s, height .2s, background .2s; will-change: transform;
}
.has-cursor .cursor.is-big { width: 56px; height: 56px; background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .header-status { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  .name { font-size: 25vw; }
  .sticker { top: 9.5rem; bottom: auto; right: var(--pad); width: 92px; }
  .name-line-2 { padding-left: 5vw; }
  .hero-intro { margin-left: 0; }
  .work-link { grid-template-columns: 2.5rem 1fr auto; grid-template-areas: "n t y" ". g g" "i i i"; gap: .4rem .75rem; align-items: baseline; padding-block: 1.25rem; }
  .work-num { grid-area: n; } .work-title { grid-area: t; } .work-year { grid-area: y; } .work-tag { grid-area: g; color: var(--muted); }
  .row-img { display: block; grid-area: i; aspect-ratio: 16 / 10; margin-top: .75rem; border: var(--border) solid var(--line); box-shadow: 6px 6px 0 var(--accent); }
  .row-img img { width: 100%; height: 100%; object-fit: cover; }
  .row-img .ph b { font-size: 1.1rem; }
  .about { grid-template-columns: 1fr; }
  .about-photo { border-right: 0; border-bottom: var(--border) solid var(--line); }
  .about-photo .ph { max-width: 420px; }
  .facts > div { grid-template-columns: 8rem 1fr; }
  .services { grid-template-columns: 1fr; }
  .service:nth-child(odd) { border-right: 0; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .clients li:nth-child(3n) { border-right: var(--border) solid var(--line); }
  .clients li:nth-child(2n) { border-right: 0; }
  .site-footer { grid-template-columns: 1fr; text-align: left; justify-items: start; }
  .footer-copy { text-align: left; } .to-top { justify-self: start; }
  .mail { font-size: clamp(1.75rem, 8.6vw, 4rem); }
  .label { font-size: clamp(2.25rem, 12vw, 4.5rem); }
  .label-count { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .marquee { transform: none; }
  .marquee-track { width: 100%; overflow-x: auto; }
  .marquee-group:nth-child(2) { display: none; }
  .btn:hover, .socials a:hover { transform: none; }
}
