/* ============================================================
   PePo Portfolio — Production Stylesheet
   Design tokens, components, motion, and responsive breakpoints.

   Breakpoints:
     - mobile:  max-width: 768px
     - tablet:  max-width: 1024px
     - desktop: 1025px and up (canonical 1440 design)
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Roxie Rossa";
  src: url("assets/RoxieRossa.otf") format("opentype");
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

/* ---------- Design tokens ---------- */
:root {
  /* Colors */
  --cream:  #F6F4EE;
  --ink:    #282828;
  --orange: #FB5434;
  --green:  #99FF99;
  --yellow: #D7D98C;
  --amber:  #FFAC1A;
  --red:    #F9383A;
  --mute:   #B8B5AC;

  /* Typography */
  --serif: "Roxie Rossa", "DM Serif Display", "Playfair Display", Georgia, serif;
  --sans:  "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono:  "Ubuntu Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Layout — desktop defaults (override per breakpoint) */
  --pad-x: 80px;
  --header-h: 128px;
  --header-pad-y: 40px;

  /* Type scale — desktop. Each is re-set in media queries */
  --fs-display-xl: 138px;   /* row marquees */
  --fs-display-l:  120px;   /* project title */
  --fs-display-m:  84px;    /* main headlines */
  --fs-display-s:  74px;    /* next project */
  --fs-display-xs: 64px;    /* email + section labels */
  --fs-display-2xs: 56px;   /* "selected works." */
  --fs-display-3xs: 40px;   /* tag strip / project section labels */
  --fs-title:      32px;    /* resume titles */
  --fs-body-l:     22px;    /* meta labels */
  --fs-body-m:     20px;    /* footer socials */
  --fs-body:       18px;    /* prose */
  --fs-body-s:     16px;    /* hero body */
  --fs-ui:         14px;    /* nav, meta */
  --fs-ui-s:       13px;    /* CTAs / dates */
  --fs-ui-xs:      12px;    /* copyright */

  /* Photo card sizes */
  --photo-w: 370px;
  --photo-h: 475px;
  --about-photo-w: 320px;
  --about-photo-h: 420px;

  /* Project rows */
  --row-h-base: 280px;
  --row-h-open: 640px;

  /* Motion */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --mq-base: 28s;
  --mq-speed: 1;

  /* Shadows */
  --shadow-photo: -10px 64px 44px 0 rgba(251, 84, 52, 0.2);
  --shadow-hero:  0 20px 60px rgba(0, 0, 0, 0.2);
  --shadow-pack:  0 30px 60px rgba(0, 0, 0, 0.18);
  --shadow-dark:  0 20px 114px rgba(0, 0, 0, 0.45);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;            /* hard prevent any horizontal overflow */
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100vh;
  width: 100%;
}

#root, main {
  width: 100%;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--orange); color: var(--cream); }
body.matrix ::selection { background: var(--green); color: #001100; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Page entry ---------- */
.page-enter { animation: pageIn .55s var(--ease-out) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-reveal-delay="1"] { transition-delay: .08s; }
.reveal[data-reveal-delay="2"] { transition-delay: .16s; }
.reveal[data-reveal-delay="3"] { transition-delay: .24s; }
.reveal[data-reveal-delay="4"] { transition-delay: .32s; }
.reveal[data-reveal-delay="5"] { transition-delay: .40s; }

.serif { font-family: var(--serif); font-weight: 400; }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); }

.page { position: relative; width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--header-pad-y) var(--pad-x);
  height: var(--header-h);
}

.logo {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--orange);
  letter-spacing: .01em;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity .25s var(--ease-out), transform .35s var(--ease-out);
}
.logo:hover { opacity: .8; transform: translateY(-1px); }

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

.nav-link {
  position: relative;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--orange);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  transition: color .25s var(--ease-out);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease-out);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.site-header.over-hero {
  height: 90px;
  padding: 32px var(--pad-x);
}
.site-header.over-hero .logo,
.site-header.over-hero .nav-link { color: inherit; }

/* Smiley badge */
.smiley-badge {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: 8px;
  transition: transform .35s var(--ease-out);
  flex-shrink: 0;
}
.smiley-badge:hover { transform: scale(1.08); }
.smiley-badge img {
  width: 84px;
  height: 84px;
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(-360deg); } }
@keyframes swirlspin { to { transform: rotate(360deg); } }

/* ============================================================
   HOME — HERO (real grid layout, no absolute positioning)
   ============================================================ */
.home-hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) var(--pad-x) 60px;
  z-index: 5;
}

.flare {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  max-width: none;
}
.flare--top {
  left: -120px;
  top: 460px;
  width: 360px;
  height: 1200px;
  opacity: .8;
  transform: rotate(-12deg);
}
.flare--bottom {
  right: 0px;
  bottom: 0px;
  width: 437px;
  height: 330px;
  opacity: .6;
  z-index: -1;
}

/* The two-column grid for the hero */
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
  position: relative;
  z-index: 2;
}

.home-hero-left {
  position: relative;
  min-height: 620px;
}

.sparkle-hero {
  width: 42px;
  height: 42px;
  position: absolute;
  top: 30px;
  left: 40px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  background: var(--orange);
  box-shadow: var(--shadow-photo);
  border-radius: 0 100px 0 0;
  transform: rotate(-10deg) skew(0.300rad);
}
.photo-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-card-tint {
  position: absolute;
  inset: 0;
  background: var(--orange);
  opacity: 0;
}

.photo-wrap {
  margin: 90px 0 0 110px;
  transform: matrix(0.996, -0.092, 0.490, 0.871, 0, 0);
  transform-origin: 0 0;
  width: fit-content;
}
.photo-card--hero {
  width: var(--photo-w);
  height: var(--photo-h);
}

.swirl-wrap {
  position: absolute;
  left: 80px;
  bottom: -40px;
  color: var(--orange);
}
.swirl-wrap img {
  width: 213px;
  height: 213px;
  animation: swirlspin 40s linear infinite;
}

.home-hero-right {
  padding-top: 40px;
  text-align: right;
}

.hero-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display-m);
  line-height: 1.05;
  color: var(--orange);
  text-align: right;
  margin: 0 auto 0 0;
  max-width: 650px;
}

.hero-body {
  font-family: var(--sans);
  font-size: var(--fs-body-s);
  line-height: 1.6;
  color: var(--orange);
  max-width: 510px;
  margin: 56px auto 0 auto;
  text-align: left;
}
.hero-body p { margin: 0 0 16px; }
.hero-body p:last-child { margin: 0; }

.selected-works-label {
  font-family: var(--serif);
  font-size: var(--fs-display-2xs);
  color: var(--orange);
  margin: 220px 0 0;
}

/* ============================================================
   PROJECT ROWS (Marquee)
   ============================================================ */
.project-rows {
  position: relative;
  margin-top: 60px;
  z-index: 5;
}
.project-rows-end { border-bottom: 1.5px solid var(--orange); }

.row {
  position: relative;
  height: var(--row-h-base);
  border-top: 1.5px solid var(--orange);
  cursor: pointer;
  overflow: hidden;
  transition: height .7s var(--ease-out);
}
.row.is-open { height: var(--row-h-open); }

.hover-sheet {
  position: absolute;
  inset: 0;
  transform: translateY(102%);
  transition: transform .55s var(--ease-out), box-shadow .35s var(--ease-out);
  z-index: 1;
}
.row.is-open .hover-sheet {
  transform: translateY(0);
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.18);
}

.row-meta {
  position: absolute;
  left: var(--pad-x);
  top: 26px;
  z-index: 4;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  opacity: .8;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: color .35s var(--ease-out), opacity .35s var(--ease-out);
}
.row.is-open .row-meta { opacity: .95; }

.row-cta {
  position: absolute;
  right: var(--pad-x);
  top: 26px;
  z-index: 4;
  font-family: var(--sans);
  font-size: var(--fs-ui-s);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.row.is-open .row-cta {
  opacity: .9;
  transform: translateX(0);
}

.marquee-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: var(--fs-display-xl);
  display: flex;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  animation: marquee calc(var(--mq-base) / var(--mq-speed)) linear infinite;
  will-change: transform;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-text {
  font-family: var(--serif);
  font-size: var(--fs-display-l);
  line-height: 1;
  white-space: nowrap;
  transition: color .35s var(--ease-out), -webkit-text-fill-color .35s var(--ease-out);
}
.marquee-fig {
  display: inline-flex;
  align-items: center;
  margin: 0 48px;
}
.fig-bottle img      { height: 110px; width: auto; max-width: fit-content !important; }
.fig-grama img       { height: 76px; width: auto; max-width: fit-content !important; }
.fig-ticket img      { height: 84px;  width: auto; max-width: fit-content !important; }
.fig-skateboard img  { height: 86px;  width: auto; max-width: fit-content !important; }
.fig-mug img         { height: 96px; width: auto; max-width: fit-content !important; }

.row[data-color-key="grip"].is-open .marquee-text {
  -webkit-text-stroke: 1px #fff;
  -webkit-text-fill-color: transparent;
}

.preview {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  transition: opacity .55s .15s var(--ease-out), transform .65s .15s var(--ease-out);
  z-index: 3;
  pointer-events: none;
  max-width: calc(100% - 80px);
}
.row.is-open .preview {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.preview img {
  max-width: 500px;
  max-height: 500px;
  width: auto;
  height: auto;
  filter: drop-shadow(-20px 44px 44px rgba(0, 0, 0, 0.30));
}

.row-swirl {
  position: absolute;
  right: 40%;
  bottom: 60px;
  z-index: 4;
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
  transition: opacity .55s .2s var(--ease-out), transform .7s .2s var(--ease-out);
  pointer-events: none;
}

.row-swirl img {
    animation: swirlspin 40s linear infinite;
}
.row-swirl img { width: 120px; height: 120px; }
.row.is-open .row-swirl {
  opacity: .85;
  transform: scale(1) rotate(0);
}

/* ============================================================
   CONTACT FOOTER
   ============================================================ */
.contact-section {
  position: relative;
  z-index: 5;
  padding: 240px var(--pad-x) 64px;
}
.contact-section.project-footer { padding: 120px var(--pad-x); }

.contact-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display-m);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--orange);
  margin: 0;
}

.contact-email-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 80px;
}
.contact-email {
  font-family: var(--serif);
  font-size: var(--fs-display-xs);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--orange);
  transition: opacity .25s var(--ease-out), transform .35s var(--ease-out), letter-spacing .35s var(--ease-out);
  max-width: 100%;
}
.contact-email:hover { letter-spacing: 0.005em; }
.contact-email .arrow-out {
  width: 48px;
  height: 48px;
  transition: transform .45s var(--ease-out);
  flex-shrink: 0;
}
.contact-email:hover .arrow-out { transform: translate(4px, -4px) rotate(8deg); }

.footer-bar {
  margin-top: 220px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 30px;
  border-top: 1px solid var(--orange);
  color: var(--orange);
}
.contact-section.project-footer .footer-bar { margin-top: 0; }

.socials {
  display: flex;
  gap: 36px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  flex-wrap: wrap;
}
.socials a {
  font-family: var(--serif);
  font-size: var(--fs-body-m);
  position: relative;
  transition: opacity .25s var(--ease-out), transform .35s var(--ease-out);
}
.socials a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease-out);
}
.socials a:hover { transform: translateY(-2px); }
.socials a:hover::after { transform: scaleX(1); }

.copyright {
  font-family: var(--mono);
  font-size: var(--fs-ui-xs);
  opacity: .6;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-headline-section {
  position: relative;
  padding: calc(var(--header-h) + 128px) var(--pad-x) 60px;
  margin-left: 128px;
  z-index: 5;
}
.about-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display-m);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--orange);
  max-width: 1100px;
  margin: 0;
}

.about-section {
  position: relative;
  padding: 120px var(--pad-x) 60px;
  z-index: 5;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}

.section-label {
  font-family: var(--serif);
  font-size: var(--fs-display-xs);
  font-weight: 400;
  line-height: 1;
  color: var(--orange);
  margin: 0 0 56px;
}

.about-photo {
  width: var(--about-photo-w);
  height: var(--about-photo-h);
  background: var(--orange);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
  position: relative;
  border-radius: 0 100px 0 0;
  max-width: 100%;
  margin: 0 0 0 64px;
}
.about-photo .photo-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-copy {
  color: var(--orange);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: 720px;
  padding: 120px 0 0;
}
.about-copy p { margin: 0 0 24px; }
.about-copy p:last-child { margin: 48px 0 0; }
.about-copy a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity .25s var(--ease-out);
}
.about-copy a:hover { opacity: .7; }

/* Tag strip marquee */
.tag-strip {
  margin: 120px 0 80px;
  border-top: 1px solid var(--orange);
  border-bottom: 1px solid var(--orange);
  overflow: hidden;
}
.tag-strip-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  padding: 18px 24px;
  color: var(--orange);
  white-space: nowrap;
  animation: marquee calc(var(--mq-base) / var(--mq-speed)) linear infinite;
  will-change: transform;
}
.tag-strip-track .tag {
  font-family: var(--serif);
  font-size: var(--fs-display-3xs);
  line-height: 1;
  color: var(--orange);
}
.tag-strip-track .tag-star {
  width: 30px;
  height: 30px;
}

/* Resume sections */
.resume-section {
  padding: 100px var(--pad-x);
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}
.resume-section .section-label { margin-bottom: 0; }
.resume-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 720px;
}
.resume-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.resume-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.resume-dates {
  font-family: var(--sans);
  font-size: var(--fs-ui-s);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--orange);
  opacity: .8;
  margin-bottom: 6px;
}
.resume-title {
  font-family: var(--serif);
  font-size: var(--fs-title);
  color: var(--orange);
  line-height: 1.1;
  margin-bottom: 6px;
}
.resume-org {
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--orange);
  opacity: .75;
}

/* ============================================================
   PROJECT DETAIL PAGE
   ============================================================ */
.project-hero {
  position: relative;
  overflow: hidden;
  padding: 180px var(--pad-x) 80px;
}

.project-hero-grad {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.project-hero-inner {
  position: relative;
  z-index: 2;
}

.project-hero-titles {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.project-title {
  font-family: var(--serif);
  font-size: var(--fs-display-l);
  line-height: 1;
  margin: 0;
}
.project-tagline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display-3xs);
  line-height: 1.1;
  margin: 32px 0 0;
  max-width: 920px;
}

.project-meta {
  margin-top: 90px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.meta-label {
  font-family: var(--serif);
  font-size: var(--fs-body-l);
  margin-bottom: 8px;
  opacity: .9;
}
.meta-value {
  font-family: var(--sans);
  font-size: var(--fs-body);
  opacity: .9;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  word-break: break-word;
}
.meta-value a {
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: opacity .25s var(--ease-out);
}
.meta-value a:hover { opacity: .8; }
.meta-value .arrow-out { width: 16px; height: 16px; flex-shrink: 0; }

.hero-img-wrap {
  margin-top: 80px;
  position: relative;
  width: 100%;
}
.hero-img {
  width: 100%;
  height: auto;
  border-radius: 28px;
}

.project-tag-strip {
  padding: 0 var(--pad-x);
  border-top: 1px solid rgba(40, 40, 40, 0.35);
  border-bottom: 1px solid rgba(40, 40, 40, 0.35);
  margin-top: -20px;
  position: relative;
  z-index: 3;
  background: var(--cream);
  overflow: hidden;
}
.project-tag-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--serif);
  font-size: var(--fs-display-3xs);
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.project-tag-strip .tag-star {
  width: 30px;
  height: 30px;
  filter: brightness(0);
  flex-shrink: 0;
}

.project-section {
  padding: 120px var(--pad-x);
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr) minmax(0, 200px);
  gap: 60px;
}
.project-section-label {
  font-family: var(--serif);
  font-size: var(--fs-display-3xs);
  margin: 0;
  font-weight: 400;
  line-height: 1.1;
}
.project-section-body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  max-width: 900px;
  color: var(--ink);
  white-space: pre-line;
}

video {
  border-radius: 28px;
  border: 10px solid var(--cream);
  box-shadow: 0px 0px 0px 1px var(--ink);
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 1280px;
}

.project-image-section { padding: 0 var(--pad-x) 100px; }
.project-image-section .img-wrap {
  position: relative;
  max-width: 1440px;
  margin: 0 24px 0 auto;
}

.project-image-section img.main {
  width: 100%;
  height: auto;
  border-radius: 13px;
}
.parallax-img {
  position: absolute;
  right: -48px;
  top: 200px;
  width: 200px;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-pack);
  will-change: transform;
  transition: transform 80ms linear;
}

.heritage-image,
.cards-image { position: relative; padding: 60px var(--pad-x); }
.heritage-image img,
.cards-image img {
  width: 100%;
  height: auto;
  border-radius: 20px;
}
.cards-image { padding: 120px var(--pad-x); }

.dark-showcase {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  padding: 100px var(--pad-x);
}

.dark-showcase-praxis {
  background-image: url("assets/praxis-restaurant-bg.jpg");
  background-position: center;
  background-size: cover;
}

.dark-showcase-nextnorth {
  background-image: url("assets/nextnorth-bg.jpg");
  background-position: center;
  background-size: cover;
}

.dark-showcase .browser-mock {
  position: absolute;
  left: 50%;
  top: 150px;
  transform: translateX(-50%);
  width: min(1064px, calc(100% - 2 * var(--pad-x)));
  max-width: 1064px;
  aspect-ratio: 1064 / 624;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-hero);
}
.dark-showcase .browser-mock img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.full-image-section img {
  width: 100%;
  height: auto;
}

.next-project-section {
  position: relative;
  padding: 120px var(--pad-x);
}
.next-project-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.next-project-btn:hover .next-arrow { transform: translate(6px, -6px); }
.next-project-headline {
  font-family: var(--serif);
  margin: 0;
  font-size: var(--fs-display-s);
  font-weight: 400;
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  max-width: 360px;
}
.next-project-headline svg {
  width: 56px;
  height: 56px;
  transition: transform .45s var(--ease-out);
}
.next-project-headline > span:last-child { width: 100%; }

/* ============================================================
   MATRIX THEME
   ============================================================ */
body.matrix {
  background: #001100;
  color: var(--green);
  --orange: #99FF99;
}
body.matrix .ink-bg,
body.matrix .project-tag-strip,
body.matrix .dark-showcase { background: #001100 !important; }
body.matrix .serif,
body.matrix h1,
body.matrix h2,
body.matrix .marquee-text {
  font-family: var(--mono) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}
body.matrix .photo-card { filter: sepia(1) hue-rotate(60deg) saturate(2.5) brightness(.9); }
body.matrix .photo-card-img { mix-blend-mode: multiply; }
body.matrix .photo-card-tint { mix-blend-mode: screen; opacity: .18 !important; }

body.matrix h1, body.matrix h2, body.matrix h3, body.matrix h4, body.matrix h5, body.matrix h6,
body.matrix p, body.matrix a, body.matrix span, body.matrix li, body.matrix dt, body.matrix dd,
body.matrix blockquote, body.matrix figcaption, body.matrix label,
body.matrix em, body.matrix strong, body.matrix small,
body.matrix td, body.matrix th, body.matrix caption,
body.matrix button, body.matrix input, body.matrix textarea,
body.matrix div {
  color: #99FF99 !important;
  text-shadow: 0 0 8px #99FF99;
}

body.matrix .swirl,
body.matrix img[src*="swirl.svg"],
body.matrix img[src*="sparkle.svg"],
body.matrix img[src*="smiley.svg"],
body.matrix img[src*="arrow.svg"],
body.matrix .tag-star {
  filter: brightness(0) saturate(100%) invert(91%) sepia(36%) saturate(536%) hue-rotate(48deg) brightness(102%) contrast(101%) !important;
}
body.matrix img[src*="flare.png"], body.matrix img[src*="flare-footer.png"] {
  filter: hue-rotate(95deg) saturate(2.5) brightness(1.4);
}
body.matrix .hero-img,
body.matrix img[src*="hover-praxis.png"],
body.matrix img[src*="hover-grama.png"],
body.matrix img[src*="hover-ccdm.png"],
body.matrix img[src*="hover-grip.png"],
body.matrix img[src*="hover-north.png"] {
  filter: hue-rotate(95deg) saturate(1.8) brightness(.9);
}
body.matrix .arrow-out path { stroke: #99FF99 !important; }
body.matrix .swirl { color: var(--green) !important; }
body.matrix .hover-sheet { background: #002200 !important; }
body.matrix .row-meta { color: var(--green) !important; }
body.matrix .product-fig { filter: hue-rotate(95deg) saturate(1.4) brightness(.85); }
body.matrix .marquee-text {
  color: #99FF99 !important;
  -webkit-text-fill-color: #99FF99 !important;
  -webkit-text-stroke: 0 !important;
}
body.matrix .rain { display: block; }

.rain {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
}

@media (min-width: 1440px) {
  .project-image-section .img-wrap {
    margin: 0 auto 0 auto;
  }

  .parallax-img {
    position: absolute;
    right: -80px;
    top: 200px;
    width: 300px;
    height: auto;
}
}

/* ============================================================
   RESPONSIVE — TABLET (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --pad-x: 48px;
    --header-h: 100px;
    --header-pad-y: 28px;

    --fs-display-xl: 96px;
    --fs-display-l:  84px;
    --fs-display-m:  60px;
    --fs-display-s:  56px;
    --fs-display-xs: 48px;
    --fs-display-2xs: 44px;
    --fs-display-3xs: 32px;
    --fs-title:      26px;
    --fs-body-l:     20px;
    --fs-body-m:     18px;
    --fs-body:       17px;
    --fs-body-s:     15px;

    --photo-w: 320px;
    --photo-h: 410px;
    --about-photo-w: 280px;
    --about-photo-h: 360px;

    --row-h-base: 180px;
    --row-h-open: 520px;
  }

  .nav { gap: 28px; }

  /* Hero — slightly tighter grid, still 2 columns */
  .home-hero-grid {
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 48px;
  }
  .home-hero-left { min-height: 540px; }
  .photo-wrap { margin: 70px 0 0 40px; }
  .swirl-wrap { left: 40px; }
  .swirl-wrap img { width: 170px; height: 170px; }
  .sparkle-hero { width: 36px; height: 36px; }

  .selected-works-label { margin: 160px 0 0; }

  /* Marquee figures scale */
  .fig-bottle img      { height: 100px; }
  .fig-grama img       { height: 90px; }
  .fig-ticket img      { height: 90px; }
  .fig-skateboard img  { height: 90px; }
  .fig-mug img         { height: 84px; }
  .fig-nextnorth img   { height: 84px; }
  .marquee-fig         { margin: 0 40px; }

  .preview img { max-width: 360px; max-height: 360px; }
  .row-swirl   { right: 40px; bottom: 40px; }
  .row-swirl img { width: 90px; height: 90px; }

  /* About */
  .about-grid,
  .resume-section {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 56px;
  }
  .about-copy { padding-top: 80px; }

  /* Project */
  .project-hero { padding: 140px var(--pad-x) 80px; }
  .project-section {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 40px;
    padding: 96px var(--pad-x);
  }
  .project-meta { margin-top: 64px; gap: 28px; }
  .dark-showcase { height: 640px; }
  .dark-showcase .browser-mock { top: 100px; }

  /* Footer */
  .contact-section { padding: 180px var(--pad-x) 56px; }
  .footer-bar { margin-top: 160px; }
  .smiley-badge,
  .smiley-badge img { width: 56px; height: 56px; }

  /* Flare repositioning */
  .flare--top { width: 280px; height: 900px; }
  .flare--bottom { width: 320px; height: 1000px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --pad-x: 24px;
    --header-h: 80px;
    --header-pad-y: 20px;

    --fs-display-xl: 64px;
    --fs-display-l:  56px;
    --fs-display-m:  40px;
    --fs-display-s:  44px;
    --fs-display-xs: 36px;
    --fs-display-2xs: 36px;
    --fs-display-3xs: 24px;
    --fs-title:      22px;
    --fs-body-l:     16px;
    --fs-body-m:     16px;
    --fs-body:       15px;
    --fs-body-s:     14px;
    --fs-ui:         13px;
    --fs-ui-s:       11px;

    --photo-w: 240px;
    --photo-h: 308px;
    --about-photo-w: 100%;
    --about-photo-h: 360px;

    --row-h-base: 128px;
    --row-h-open: 420px;
  }

  .logo { font-size: 22px; }
  .nav { gap: 18px; }
  .smiley-badge,
  .smiley-badge img { width: 44px; height: 44px; }

  /* Hero — stack to single column */
  .home-hero {
    padding-top: calc(var(--header-h) + 40px);
  }
  .home-hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .home-hero-left {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .photo-wrap {
    margin: 30px 0 0;
    transform: matrix(0.996, -0.092, 0.245, 0.935, 0, 0);
  }
  .photo-card {
      transform: rotate(-9deg) skew(0.200rad);
  }
  .sparkle-hero {
    top: 0;
    left: 0;
    position: relative;
    align-self: flex-start;
    width: 32px;
    height: 32px;
    margin-bottom: -16px;
    margin-left: 8px;
  }
  .swirl-wrap {
    position: relative;
    left: 20px;
    bottom: auto;
    margin-top: -40px;
    align-self: flex-start;
  }
  .swirl-wrap img { width: 130px; height: 130px; }

  .home-hero-right {
    padding-top: 0;
    text-align: left;
  }
  .hero-headline { text-align: left; }
  .hero-body {
    margin: 32px 0 0;
    max-width: 100%;
  }
  
  video {
     border-radius: 8px;
    border: 4px solid var(--cream);
  }
  
  .project-rows {
    margin-top: 0;
  }

  .selected-works-label { margin: 100px 0 0; }

  /* Project rows shrink dramatically. Smaller titles, smaller figures. */
  .row { cursor: default; }
  .row-meta { left: var(--pad-x); top: 14px; font-size: 11px; }
  .row-cta { display: none; }
  .row-swirl { right: 16px; bottom: 16px; }
  .row-swirl img { width: 56px; height: 56px; }
  .marquee-rail { height: var(--fs-display-xl); }
  .marquee-fig { margin: 0 20px; }
  .fig-bottle img      { height: 64px; }
  .fig-ticket img      { height: 48px; }
  .fig-grama img       { height: 48px; }
  .fig-skateboard img  { height: 48px; }
  .fig-mug img         { height: 52px; }
  .fig-nextnorth img   { height: 52px; }
  .preview img { max-width: 240px; max-height: 240px; }

  /* About */
  .about-headline-section { padding-top: calc(var(--header-h) + 40px); margin-left: 40px; }
  .about-grid,
  .resume-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .section-label { margin-bottom: 32px; }
  .resume-section { padding: 64px var(--pad-x); }
  .about-section { padding: 80px var(--pad-x) 40px; }
  .about-copy { padding-top: 0; }
  .about-photo {
    max-width: 100%;
    width: 100%;
    height: 360px;
    margin: 0;
  }
  .about-copy p:last-child { margin-top: 32px; }

  /* Tag strip — slower visually on small width */
  .tag-strip { margin: 80px 0 56px; }
  .tag-strip-track { gap: 28px; padding: 14px 16px; }
  .tag-strip-track .tag-star { width: 20px; height: 20px; }

  /* Project page */
  .project-hero { padding: 120px var(--pad-x) 60px; }
  .project-hero-titles { grid-template-columns: 1fr; gap: 16px; }
  .project-tagline { margin-top: 8px; }
  .project-meta {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 48px;
  }
  .project-tag-strip-inner {
    padding: 12px 0;
    font-size: var(--fs-title);
    justify-content: flex-start;
    gap: 12px;
  }
  .project-tag-strip { margin-top: -20px; }
  .project-tag-strip .tag-star { width: 20px; height: 20px; }

  .project-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 64px var(--pad-x);
  }
  .project-image-section { padding: 0 var(--pad-x) 64px; }
  .parallax-img {
    width: 100px;
    right: -24px;
    top: 56px;
    border-radius: 12px;
  }
  .heritage-image,
  .cards-image { padding: 40px var(--pad-x); }
  .cards-image { padding: 60px var(--pad-x); }
  .heritage-image img, .cards-image img {
    border-radius: 8px;
}
  .dark-showcase {
    height: 360px;
    padding: 80px var(--pad-x);
  }
  .dark-showcase .browser-mock {
    top: 60px;
  }
  .next-project-section { padding: 80px var(--pad-x); }
  .next-project-headline { gap: 14px; max-width: 100%; }
  .next-project-headline svg { width: 36px; height: 36px; }
  .hero-img { border-radius: 16px; height: 320px; object-fit: cover;}

  /* Footer */
  .contact-section { padding: 120px var(--pad-x) 40px; }
  .contact-section.project-footer { padding: 64px var(--pad-x); }
  .contact-email {
    font-size: var(--fs-display-xs);
  }
  .contact-email .arrow-out { width: 28px; height: 28px; }
  .contact-email-row { margin-top: 40px; }
  .footer-bar {
    margin-top: 120px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .socials { gap: 20px; }

  /* Flare softer on mobile to avoid overflow + visual clutter */
  .flare--top { width: 180px; height: 600px; opacity: .5; left: -80px; }
  .flare--bottom { width: 200px; height: 600px; opacity: .6; right: -80px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track,
  .tag-strip-track,
  .swirl-wrap img,
  .smiley-badge img { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .parallax-img { transform: none !important; }
}
