/* ============================================================
   Juan F. Gutierrez — Portfolio · Design System
   Aesthetic: cinematic dark, game-menu inspired, condensed
   display type, thin rule dividers, left-anchored navigation,
   contextual prompts in corners. A nod to a background that
   began in interactive media — reframed for product design.
   ============================================================ */

:root {
  /* Palette — desaturated cool greys with a touch of warmth */
  --bg-0:        #07090a;       /* deepest */
  --bg-1:        #0c0f10;       /* page bg */
  --bg-2:        #14181a;       /* card / panel */
  --bg-3:        #1c2123;       /* elevated */
  --line:        #2a3033;
  --line-soft:   rgba(255,255,255,0.08);
  --line-faint:  rgba(255,255,255,0.04);

  --fg-0:        #f2efe8;       /* warm white — primary text */
  --fg-1:        #c9c5bd;       /* secondary */
  --fg-2:        #8a8780;       /* tertiary */
  --fg-3:        #5a5852;       /* disabled / inactive menu */
  --fg-4:        #38362f;       /* deepest fg */

  --accent:      #e9e4d8;       /* selected — almost-white warm */
  --accent-dim:  #948f80;
  --hazard:      oklch(0.62 0.14 50);  /* warm amber, used sparingly */

  /* Type */
  --display:    "Oswald", "Arial Narrow", sans-serif;
  --label:      "Barlow Condensed", "Oswald", sans-serif;
  --body:       "Manrope", "Helvetica Neue", sans-serif;
  --mono:       "JetBrains Mono", "Menlo", monospace;
  --hand:       "Caveat", cursive;

  /* Sizing */
  --rule: 1px;
  --container: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
}

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

html, body {
  background: var(--bg-1);
  color: var(--fg-0);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--fg-0); color: var(--bg-0); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

/* ───── Type utilities ───── */
.display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 0.95;
  text-transform: uppercase;
}
.label {
  font-family: var(--label);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kicker {
  font-family: var(--label);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--fg-2);
}
.mono { font-family: var(--mono); }

/* Thin rule used throughout, like menu separators */
.rule {
  height: var(--rule);
  background: var(--line-soft);
  width: 100%;
}

/* ════════════════════════════════════════════════════════════
   TOP HEADER (revealed on scroll)
   ════════════════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(to bottom, rgba(7,9,10,0.92), rgba(7,9,10,0.75) 70%, rgba(7,9,10,0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 480ms cubic-bezier(.2,.7,.2,1), opacity 320ms ease;
  pointer-events: none;
}
.site-header.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.site-header__mark {
  font-family: var(--label);
  font-weight: 500;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--fg-0);
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header__mark .dot {
  width: 6px; height: 6px;
  background: var(--fg-0);
  display: inline-block;
}
.site-header__mark .sub {
  color: var(--fg-2);
  font-weight: 300;
}
.site-header__nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.site-header__nav a {
  font-family: var(--label);
  font-weight: 400;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--fg-2);
  transition: color 200ms ease;
  position: relative;
  padding: 6px 0;
}
.site-header__nav a:hover,
.site-header__nav a.is-active { color: var(--fg-0); }
.site-header__nav a.is-active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 6px; height: 1px;
  background: var(--fg-0);
  transform: translateY(-50%);
}

/* ════════════════════════════════════════════════════════════
   HERO — full-bleed atmospheric backdrop + main-menu rail
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* Video layer */
.hero__video,
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero__poster {
  /* Atmospheric placeholder — slow ken-burns */
  background:
    radial-gradient(ellipse 80% 50% at 60% 40%, rgba(72, 84, 88, 0.35), transparent 70%),
    radial-gradient(ellipse 60% 80% at 30% 80%, rgba(20, 30, 35, 0.8), transparent 60%),
    linear-gradient(180deg, #1a2024 0%, #0c1013 60%, #07090a 100%);
  animation: kenburns 24s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1.05) translate(-1%, -1%); }
  to   { transform: scale(1.15) translate(2%, 1%); }
}

/* Grain + vignette overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.3) 35%, transparent 60%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Bottom fog → next-section transition */
.hero__fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 36vh;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(12,15,16, 0.45) 35%,
    rgba(12,15,16, 0.85) 70%,
    var(--bg-1) 100%);
}

/* Top brand strip inside the hero */
.hero__topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px var(--gutter) 0;
  gap: 24px;
}
.hero__mark {
  font-family: var(--label);
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero__mark .glyph {
  width: 10px; height: 10px;
  border: 1px solid var(--fg-1);
  display: inline-block;
  transform: rotate(45deg);
}
.hero__status {
  font-family: var(--label);
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__status .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hazard);
  box-shadow: 0 0 12px var(--hazard);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.05); }
}

/* Main menu rail */
.hero__menu {
  position: relative;
  z-index: 10;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
  gap: 40px;
  align-items: center;
  padding: 4vh var(--gutter) 12vh;
}
.menu-block {
  max-width: 620px;
}
.menu-block__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 6.2vw, 96px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--fg-0);
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.menu-block__name .small {
  display: block;
  font-size: 0.52em;
  font-weight: 400;
  color: var(--fg-1);
  margin-bottom: 0.15em;
}
.menu-block__title {
  font-family: var(--label);
  letter-spacing: 0.32em;
  font-size: 12px;
  color: var(--fg-1);
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  max-width: 460px;
  line-height: 1.6;
}

/* Menu list (like a game's main-menu options) */
.menu-list {
  margin-top: 56px;
  border-top: 1px solid var(--line-soft);
}
.menu-list__item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 4px 16px 28px;
  font-family: var(--label);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  position: relative;
  transition: color 240ms ease, padding 240ms ease, letter-spacing 240ms ease;
  width: 100%;
  text-align: left;
}
.menu-list__item:hover,
.menu-list__item.is-active {
  color: var(--fg-0);
  padding-left: 36px;
  letter-spacing: 0.18em;
}
.menu-list__item::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--fg-0);
  transform: translateY(-50%);
  transition: height 240ms ease;
}
.menu-list__item:hover::before,
.menu-list__item.is-active::before {
  height: 70%;
}
.menu-list__item .num {
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.25em;
  min-width: 28px;
}
.menu-list__item .arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 240ms ease, transform 240ms ease;
  font-size: 14px;
  color: var(--fg-1);
}
.menu-list__item:hover .arrow,
.menu-list__item.is-active .arrow {
  opacity: 1;
  transform: translateX(0);
}
.menu-list__item .desc {
  margin-left: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fg-3);
  opacity: 0;
  transition: opacity 240ms ease;
}
.menu-list__item:hover .desc,
.menu-list__item.is-active .desc {
  opacity: 1;
}

/* Bottom prompt row (like a SELECT / BACK control row) */
.hero__prompts {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter) 28px;
  border-top: 1px solid var(--line-faint);
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--fg-2);
}
.hero__prompts .left,
.hero__prompts .right {
  display: flex;
  align-items: center;
  gap: 26px;
}
.prompt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.prompt .key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--fg-2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  color: var(--fg-1);
}
.prompt .key.circle {
  border-radius: 50%;
  width: 22px;
  padding: 0;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--fg-2);
  pointer-events: none;
}
.scroll-cue__bar {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--fg-2), transparent);
  animation: scrollbar 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollbar {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0) translateY(48px); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   SECTION SCAFFOLDING
   ════════════════════════════════════════════════════════════ */
section.page-section {
  position: relative;
  padding: 140px var(--gutter) 120px;
  background: var(--bg-1);
}
section.page-section + section.page-section {
  border-top: 1px solid var(--line-soft);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line-soft);
}
.section-head__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.section-head__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 64px);
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: uppercase;
}
.section-head__meta {
  font-family: var(--label);
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--fg-2);
}
.section-head__lede {
  max-width: 720px;
  color: var(--fg-1);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
}

/* ════════════════════════════════════════════════════════════
   WORK — list/preview layout
   ════════════════════════════════════════════════════════════ */
.work {
  display: grid;
  grid-template-columns: minmax(380px, 42%) 1fr;
  gap: 64px;
  align-items: start;
}
.work__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}
.work__cat {
  padding: 24px 0 8px;
  font-family: var(--label);
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--fg-2);
}
.work__entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px 18px 24px;
  font-family: var(--label);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  position: relative;
  transition: color 240ms ease, padding 240ms ease;
  text-align: left;
  width: 100%;
}
.work__entry:hover,
.work__entry.is-active {
  color: var(--fg-0);
  padding-left: 32px;
}
.work__entry::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--fg-0);
  transform: translateY(-50%);
  transition: height 240ms ease;
}
.work__entry:hover::before,
.work__entry.is-active::before { height: 64%; }
.work__entry .glyph {
  color: var(--fg-3);
  font-size: 14px;
}
.work__entry.is-active .glyph { color: var(--fg-1); }

/* Preview pane */
.work__preview {
  position: sticky;
  top: 120px;
}
.work__preview-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.work__preview-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.work__preview-frame .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 14px,
    transparent 14px,
    transparent 28px
  );
}
.work__preview-frame .placeholder .label-tx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.1em;
}
.work__preview-frame .placeholder .name {
  font-family: var(--display);
  font-size: 20px;
  color: var(--fg-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.work__preview-meta {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
}
.work__preview-meta dt {
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.work__preview-meta dd {
  font-family: var(--body);
  font-size: 0.875rem;
  color: var(--fg-0);
}
.work__preview-desc {
  margin-top: 22px;
  color: var(--fg-1);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 620px;
  text-wrap: pretty;
}
.work__preview-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  font-family: var(--label);
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--fg-0);
  padding: 12px 18px;
  border: 1px solid var(--line);
  transition: background 200ms ease, border-color 200ms ease;
}
.work__preview-cta:hover {
  background: var(--bg-2);
  border-color: var(--fg-1);
}

/* ════════════════════════════════════════════════════════════
   ABOUT
   ════════════════════════════════════════════════════════════ */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.about__bio p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg-1);
  margin-bottom: 1.2em;
  text-wrap: pretty;
}
.about__bio p strong { color: var(--fg-0); font-weight: 600; }
.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.about__stat {
  background: var(--bg-1);
  padding: 28px 22px;
}
.about__stat dt {
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--fg-2);
  margin-bottom: 18px;
}
.about__stat dd {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--fg-0);
}
.about__stat dd .unit {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-2);
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
}

/* Skills tag list */
.skills {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.skill {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--fg-1);
  background: var(--bg-2);
}

/* ════════════════════════════════════════════════════════════
   PROCESS
   ════════════════════════════════════════════════════════════ */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.process__step {
  background: var(--bg-1);
  padding: 36px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 280px;
  position: relative;
}
.process__step .num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 600;
  color: var(--fg-3);
  line-height: 1;
}
.process__step .name {
  font-family: var(--label);
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-0);
}
.process__step .body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ════════════════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════════════════ */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
}
.contact__lede {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--fg-0);
}
.contact__lede em {
  font-style: normal;
  color: var(--fg-2);
}
.contact__links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}
.contact__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--label);
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-1);
  transition: color 200ms ease, padding 200ms ease;
}
.contact__link:hover {
  color: var(--fg-0);
  padding-left: 12px;
}
.contact__link .arrow { color: var(--fg-3); }
.contact__link:hover .arrow { color: var(--fg-0); }

/* Footer */
.site-footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--fg-3);
  background: var(--bg-0);
}

/* ════════════════════════════════════════════════════════════
   HERO BACKGROUND VARIANTS (set via Options if desired)
   ════════════════════════════════════════════════════════════ */
body.no-grain .hero::after { display: none; }

body[data-video-mode="Fog (lighter)"] .hero__poster {
  background:
    radial-gradient(ellipse 90% 60% at 50% 40%, rgba(140, 150, 155, 0.35), transparent 70%),
    radial-gradient(ellipse 70% 80% at 40% 80%, rgba(60, 75, 82, 0.6), transparent 60%),
    linear-gradient(180deg, #2d343a 0%, #181d21 60%, #0c1013 100%);
}
body[data-video-mode="Pitch black"] .hero__poster {
  background:
    radial-gradient(ellipse 60% 40% at 70% 30%, rgba(255,255,255,0.04), transparent 70%),
    #050607;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .hero__menu { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; }
  .work__preview { position: static; }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .process { grid-template-columns: 1fr 1fr; }
  .site-header__nav { display: none; }
}
@media (max-width: 560px) {
  .process { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: 1fr; }
  .hero__prompts { font-size: 9px; gap: 14px; }
  .hero__prompts .left, .hero__prompts .right { gap: 14px; }
}
