/* ============================================================
   PHANTOM PORTFOLIO — Persona 5 Royal Design System
   Palette + typography extracted from original P5R assets
   (ant-8/persona-menu: UXFont.ttf, sprite PNGs, InitBG.jpg)
   ============================================================ */

:root {
  /* --- Core P5R palette (sampled from original game assets) --- */
  --p5-red:        #FF1C1C;  /* loadgame_card_hover.png — 1.1M px */
  --p5-red-deep:   #A62222;  /* card hover shadow tone */
  --p5-red-ember:  #F5240E;  /* loadgame_header.png accent */
  --p5-black:      #101010;  /* configbg.png — 948K px, the menu void */
  --p5-black-pure: #000000;
  --p5-white:      #EBEBEB;  /* config_off/on.png — the paper white */
  --p5-cyan:       #98F2FF;  /* hover sprites — the "selected" glow */
  --p5-bg-red:     #420009;  /* InitBG.jpg deep vignette */
  --p5-bg-red-2:   #58000B;

  /* --- Semantic mapping --- */
  --bg:            var(--p5-black);
  --bg-elev:       #161616;
  --bg-deep:       #0A0A0A;
  --fg:            var(--p5-white);
  --fg-dim:        #939393;
  --fg-faint:      #5A5A5A;
  --accent:        var(--p5-red);
  --accent-hot:    var(--p5-red-ember);
  --accent-cool:   var(--p5-cyan);
  --border:        #2A2A2A;
  --border-hot:    var(--p5-red);

  /* --- Typography --- */
  --font-display: 'Personified UX', 'Arial Black', 'Helvetica Neue', sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* --- P5R signature: hard black outline on everything --- */
  --outline: 3px solid var(--p5-black-pure);
  --outline-thin: 2px solid var(--p5-black-pure);

  /* --- The P5R diagonal skew --- */
  --skew: -8deg;
  --skew-inv: 8deg;

  /* --- Hard offset shadow (no blur, pure neubrutalist) --- */
  --shadow-hard: 6px 6px 0 var(--p5-black-pure);
  --shadow-hard-sm: 4px 4px 0 var(--p5-black-pure);
  --shadow-red: 6px 6px 0 var(--p5-red-deep);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { }

/* NOTE: scroll-behavior:smooth is intentionally NOT set on <html>.
   It breaks programmatic scrolling in headless/CDP-driven browsers
   (window.scrollTo silently no-ops). Smooth scrolling is implemented
   in JS instead, with a prefers-reduced-motion guard. */

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--p5-red); color: var(--p5-white); }

/* ============================================================
   FONT FACES
   ============================================================ */
@font-face {
  font-family: 'Personified UX';
  src: url('../fonts/PersonifiedUX.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   GLOBAL TEXTURE — halftone dots + vignette, P5R signature
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: radial-gradient(circle, rgba(0,0,0,0.18) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.5;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ============================================================
   SCROLLBAR — P5R styled
   ============================================================ */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--p5-black-pure); }
::-webkit-scrollbar-thumb {
  background: var(--p5-red);
  border: 2px solid var(--p5-black-pure);
}
::-webkit-scrollbar-thumb:hover { background: var(--p5-red-ember); }

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  position: relative;
  z-index: 2;
}

section { position: relative; padding: clamp(4rem, 10vh, 8rem) 0; }

/* ============================================================
   THE P5R SKEWED BANNER — the signature red slash
   ============================================================ */
.slash {
  display: inline-block;
  background: var(--p5-red);
  color: var(--p5-white);
  font-family: var(--font-display);
  text-transform: uppercase;
  padding: 0.4em 1.2em;
  transform: skewX(var(--skew));
  border: var(--outline);
  box-shadow: var(--shadow-hard-sm);
  letter-spacing: 0.04em;
  position: relative;
}
.slash > * { display: inline-block; transform: skewX(var(--skew-inv)); }

/* ============================================================
   HEADINGS — display font, hard outline
   ============================================================ */
h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(3rem, 9vw, 7.5rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 2rem); }

/* P5R text outline treatment */
.outlined {
  color: var(--p5-white);
  text-shadow:
    -3px -3px 0 var(--p5-black-pure),
     3px -3px 0 var(--p5-black-pure),
    -3px  3px 0 var(--p5-black-pure),
     3px  3px 0 var(--p5-black-pure);
}

.outlined-red {
  color: var(--p5-red);
  text-shadow:
    -3px -3px 0 var(--p5-black-pure),
     3px -3px 0 var(--p5-black-pure),
    -3px  3px 0 var(--p5-black-pure),
     3px  3px 0 var(--p5-black-pure);
}

/* ============================================================
   NAVIGATION — the P5R top bar
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(16,16,16,0.92);
  backdrop-filter: blur(6px);
  border-bottom: var(--outline-thin);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--p5-red);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-logo .star { color: var(--p5-white); font-size: 1.1rem; }
.nav-links { display: flex; gap: 0.5rem; list-style: none; align-items: center; }
.nav-links a {
  font-family: var(--font-display);
  color: var(--p5-white);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
  border: 2px solid transparent;
  transition: none;
  letter-spacing: 0.04em;
}
.nav-links a:hover {
  background: var(--p5-red);
  border-color: var(--p5-black-pure);
  box-shadow: var(--shadow-hard-sm);
  transform: translate(-2px,-2px);
}
.nav-toggle { display: none; }

/* ============================================================
   HERO — full-bleed P5R title screen
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse at 30% 40%, var(--p5-bg-red) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(88,0,11,0.5) 0%, transparent 55%),
    var(--p5-black-pure);
  overflow: hidden;
  padding-top: 68px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  width: 100%;
}
.hero-tag {
  font-family: var(--font-display);
  color: var(--p5-cyan);
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  margin-bottom: 1.25rem;
  display: block;
}
.hero-title {
  margin-bottom: 1.5rem;
}
.hero-title .line-1 { color: var(--p5-white); display: block; }
.hero-title .line-2 {
  color: var(--p5-red);
  display: block;
  text-shadow:
    -4px -4px 0 var(--p5-black-pure), 4px -4px 0 var(--p5-black-pure),
    -4px  4px 0 var(--p5-black-pure), 4px  4px 0 var(--p5-black-pure);
}
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--p5-white);
  max-width: 34rem;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}
.hero-sub strong { color: var(--p5-cyan); font-weight: 700; }
.hero-cta { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }

/* ============================================================
   BUTTONS — P5R menu item style
   ============================================================ */
.btn {
  font-family: var(--font-display);
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  border: var(--outline);
  cursor: pointer;
  transition: none;
  position: relative;
  transform: skewX(var(--skew));
}
.btn > * { transform: skewX(var(--skew-inv)); }
.btn-primary {
  background: var(--p5-red);
  color: var(--p5-white);
  box-shadow: var(--shadow-hard);
}
.btn-primary:hover {
  background: var(--p5-red-ember);
  transform: skewX(var(--skew)) translate(-3px,-3px);
  box-shadow: 9px 9px 0 var(--p5-black-pure);
}
.btn-ghost {
  background: transparent;
  color: var(--p5-white);
  box-shadow: var(--shadow-hard);
}
.btn-ghost:hover {
  background: var(--p5-white);
  color: var(--p5-black);
  transform: skewX(var(--skew)) translate(-3px,-3px);
  box-shadow: 9px 9px 0 var(--p5-black-pure);
}

/* ============================================================
   HERO SIDE — the calling-card silhouette
   ============================================================ */
.hero-card {
  position: relative;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card .card-bg {
  position: absolute;
  inset: 0;
  background: var(--p5-red);
  border: var(--outline);
  box-shadow: var(--shadow-red);
  transform: rotate(-4deg);
}
.hero-card .card-bg-2 {
  position: absolute;
  inset: 0;
  background: var(--p5-black-pure);
  border: var(--outline);
  transform: rotate(3deg);
}
.hero-card .card-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem;
}
.hero-card .mask {
  font-size: clamp(5rem, 12vw, 10rem);
  line-height: 1;
  color: var(--p5-white);
  font-family: var(--font-display);
  text-shadow:
    -4px -4px 0 var(--p5-black-pure), 4px -4px 0 var(--p5-black-pure),
    -4px  4px 0 var(--p5-black-pure), 4px  4px 0 var(--p5-black-pure);
}
.hero-card .mask-label {
  font-family: var(--font-display);
  color: var(--p5-black);
  background: var(--p5-white);
  display: inline-block;
  padding: 0.3rem 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ============================================================
   MARQUEE — the P5R scrolling text band
   ============================================================ */
.marquee {
  background: var(--p5-red);
  border-top: var(--outline);
  border-bottom: var(--outline);
  overflow: hidden;
  padding: 0.9rem 0;
  position: relative;
  z-index: 3;
}
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 22s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  color: var(--p5-white);
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.marquee .sep { color: var(--p5-black-pure); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   SECTION HEADERS — the P5R chapter title
   ============================================================ */
.sec-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); position: relative; }
.sec-head .kicker {
  font-family: var(--font-display);
  color: var(--p5-cyan);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.75rem;
}
.sec-head h2 { color: var(--p5-white); }
.sec-head h2 em { color: var(--p5-red); font-style: normal; }
.sec-head .rule {
  height: 5px;
  background: var(--p5-red);
  border: var(--outline-thin);
  width: 120px;
  margin-top: 1.25rem;
}

/* ============================================================
   WORK CARDS — P5R calling-card grid
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.work-card {
  background: var(--bg-elev);
  border: var(--outline);
  box-shadow: var(--shadow-hard);
  position: relative;
  overflow: hidden;
  transition: none;
  display: flex;
  flex-direction: column;
}
.work-card:hover {
  transform: translate(-4px,-4px);
  box-shadow: 10px 10px 0 var(--p5-red-deep);
}
.work-card .thumb {
  aspect-ratio: 16/10;
  background: var(--p5-black-pure);
  border-bottom: var(--outline);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.1);
}
.work-card .thumb .num {
  position: absolute;
  top: 0; left: 0;
  background: var(--p5-red);
  color: var(--p5-white);
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 0.35rem 0.9rem;
  border-right: var(--outline-thin);
  border-bottom: var(--outline-thin);
  z-index: 2;
}
.work-card .body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.work-card h3 { color: var(--p5-white); margin-bottom: 0.6rem; font-size: 1.35rem; }
.work-card p { color: var(--p5-white); font-size: 0.95rem; margin-bottom: 1.25rem; flex: 1; }
.work-card .tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p5-cyan);
  border: 1px solid var(--p5-cyan);
  padding: 0.2rem 0.6rem;
  background: rgba(152,242,255,0.06);
}
.work-card .link-row {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}
.work-card .link-row a {
  font-family: var(--font-display);
  color: var(--p5-red);
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.work-card .link-row a:hover { color: var(--p5-cyan); }

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats {
  background: var(--p5-black-pure);
  border-top: var(--outline);
  border-bottom: var(--outline);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat .val {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  color: var(--p5-red);
  line-height: 1;
  display: block;
  text-shadow:
    -3px -3px 0 var(--p5-black-pure), 3px -3px 0 var(--p5-black-pure),
    -3px  3px 0 var(--p5-black-pure), 3px  3px 0 var(--p5-black-pure);
}
.stat .lbl {
  font-family: var(--font-display);
  color: var(--p5-white);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  margin-top: 0.75rem;
  display: block;
}

/* ============================================================
   ABOUT — split layout
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about-portrait {
  border: var(--outline);
  box-shadow: var(--shadow-hard);
  background: var(--p5-black-pure);
  aspect-ratio: 4/5;
  overflow: hidden;
  position: relative;
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.1) saturate(0.9); }
.about-portrait .frame-tag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--p5-red);
  border-top: var(--outline);
  font-family: var(--font-display);
  color: var(--p5-white);
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
}
.about-text h3 { color: var(--p5-red); margin-bottom: 1.25rem; }
.about-text p { color: var(--p5-white); margin-bottom: 1.25rem; line-height: 1.85; font-size: 1.02rem; }
.about-text p strong { color: var(--p5-cyan); }
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
  list-style: none;
}
.skills-list li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--p5-white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--p5-red);
  padding: 0.6rem 0.85rem;
  background: var(--bg-elev);
}

/* ============================================================
   CONTACT — the calling card finale
   ============================================================ */
.contact {
  background:
    radial-gradient(ellipse at 50% 120%, var(--p5-bg-red) 0%, transparent 55%),
    var(--p5-black-pure);
  text-align: center;
}
.contact .big {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  color: var(--p5-white);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1.5rem;
  text-shadow:
    -4px -4px 0 var(--p5-black-pure), 4px -4px 0 var(--p5-black-pure),
    -4px  4px 0 var(--p5-black-pure), 4px  4px 0 var(--p5-black-pure);
}
.contact .big em { color: var(--p5-red); font-style: normal; }
.contact p { color: var(--p5-white); max-width: 40rem; margin: 0 auto 2.5rem; font-size: 1.1rem; line-height: 1.8; }
.contact-links { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--p5-black-pure);
  border-top: var(--outline);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer .fname {
  font-family: var(--font-display);
  color: var(--p5-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer .fmeta {
  font-family: var(--font-mono);
  color: var(--p5-white);
  font-size: 0.8rem;
}

/* ============================================================
   REVEAL ANIMATION — P5R menu slide-in
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px) skewX(var(--skew));
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1),
              transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in { opacity: 1; transform: translateY(0) skewX(0deg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 340px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 380px; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: var(--p5-black-pure);
    border-bottom: var(--outline);
    flex-direction: column;
    padding: 1.25rem;
    gap: 0.5rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: var(--outline-thin);
    padding: 0.6rem;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 24px; height: 3px;
    background: var(--p5-white);
  }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
