/* ==========================================================
   Louis Albertini — Portfolio mockup
   Design system: dark, cyan accent, Space Grotesk + Inter
   ========================================================== */

:root {
  --bg: #101014;
  --card: #1c1c24;
  --line: #2a2a33;
  --line-2: #3a3a46;
  --line-header: #23232b;
  --text: #ECEAE4;
  --text-2: #C9C7CE;
  --muted: #A3A1A8;
  --cyan: #3CCBE6;
  --cyan-hover: #6FDCF0;
  --note: #9EE7F4;
  --note-text: #0E2A31;
  --header-h: 72px;
  --gutter: 40px;
  --radius: 6px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  background: var(--cyan); color: var(--bg);
  padding: 12px 18px; border-radius: var(--radius); font-weight: 600;
}
.skip:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(16, 16, 20, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-header);
}
.site-header .bar {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font: 700 20px/1 var(--font-head);
  display: inline-flex; align-items: center; min-height: 44px;
  white-space: nowrap;
}
.brand:hover { color: var(--cyan); }
.site-header nav { display: flex; align-items: center; gap: 12px; }
.site-header nav a {
  display: inline-block; height: 44px; line-height: 44px; padding: 0 10px;
  color: var(--text-2); font-weight: 500; font-size: 15px; white-space: nowrap;
}
.site-header nav a:hover { color: var(--cyan); }
.site-header nav a[aria-current="page"] { color: var(--cyan); font-weight: 600; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font: 600 13px/1.3 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 16px;
}
.h-display {
  font: 700 clamp(40px, 6vw, 72px)/1.05 var(--font-head);
  letter-spacing: -0.02em;
}
.h-section {
  font: 700 clamp(32px, 4.5vw, 56px)/1.08 var(--font-head);
  letter-spacing: -0.02em;
}
.lead { font-size: 18px; color: var(--text-2); max-width: 680px; }

/* ---------- Links & buttons ---------- */
.link {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; font-weight: 500; color: var(--text);
}
.link:hover { color: var(--cyan); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: transparent; color: var(--text);
  font: 600 15px/1 var(--font-body); cursor: pointer;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.btn-primary:hover { background: var(--cyan-hover); border-color: var(--cyan-hover); color: var(--bg); }

.more {
  display: inline-flex; align-items: center; gap: 16px;
  min-height: 48px; font-weight: 500; color: var(--text);
}
.more .circle {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-2);
  display: inline-grid; place-items: center;
}
.more:hover { color: var(--cyan); }
.more:hover .circle { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Placeholder frames ---------- */
.ph {
  display: grid; place-items: center; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font: 500 12px/1.4 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 12px;
  width: 100%;
}
.ph:has(img) { position: relative; padding: 0; overflow: hidden; }
.ph img {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; object-fit: cover;
}
.r-169 { aspect-ratio: 16 / 9; }
.r-45 { aspect-ratio: 4 / 5; }
.r-43 { aspect-ratio: 4 / 3; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 48px;
}
.page-head { padding: 96px 0 56px; }
.page-head .lead { margin-top: 24px; }
main > .container:last-child, main > section:last-child { padding-bottom: 120px; }

/* ---------- Cards grid ---------- */
.grid {
  display: grid; gap: 40px 28px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card { display: block; }
.card .ph { transition: border-color 0.2s; }
.card:hover .ph { border-color: var(--cyan); }
.card h3 { font: 600 20px/1.3 var(--font-head); margin: 16px 0 4px; }
.card .meta { font-size: 14px; color: var(--muted); }

/* ---------- Home: hero ---------- */
.hero {
  position: sticky; top: 0; z-index: 0;
  height: min(100vh, 900px);
  height: min(100svh, 900px);
  margin-top: calc(var(--header-h) * -1);
  display: grid; place-items: center; text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: var(--card);
  display: grid; justify-items: center; align-content: start;
  padding-top: 120px;
  color: var(--muted);
  font: 500 12px/1.4 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em;
}
.hero-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(16, 16, 20, 0.35);
}
.hero-bg span { position: relative; z-index: 1; }
.hero-content { position: relative; z-index: 1; padding: 0 var(--gutter); }
.hero h1 {
  font: 700 clamp(48px, 9vw, 128px)/1.05 var(--font-head);
  letter-spacing: -0.02em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.45);
}
.hero .role {
  margin-top: 20px;
  font: 500 clamp(14px, 1.6vw, 18px)/1.3 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.24em;
  color: var(--text);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 600 13px/1 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.8);
}
.scroll-cue .ico {
  width: 28px; height: 28px; stroke-width: 2.25;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.9));
}

.after {
  position: relative; z-index: 2;
  background: var(--bg);
}
/* Soft gradient above the first section: no visible edge while scrolling */
.after::before {
  content: ""; position: absolute; left: 0; right: 0;
  top: -240px; height: 240px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(16, 16, 20, 0) 0%,
    rgba(16, 16, 20, 0.04) 15%,
    rgba(16, 16, 20, 0.16) 35%,
    rgba(16, 16, 20, 0.42) 58%,
    rgba(16, 16, 20, 0.76) 80%,
    #101014 100%);
}

/* Scroll-driven fade + rise */
@keyframes hero-fade { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: translateY(0); }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero {
      animation: hero-fade linear both;
      animation-timeline: scroll(root);
      animation-range: 0 700px;
    }
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }
}

/* ---------- Home: About ---------- */
.about {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 72px; align-items: start;
}
.about .h-section { margin-bottom: 28px; }
.about p + p { margin-top: 16px; }
.about .text p { color: var(--text-2); font-size: 18px; max-width: 620px; }
.postit {
  margin: 48px 0 32px;
  max-width: 520px;
  background: var(--note); color: var(--note-text);
  padding: 28px 32px 32px;
  transform: rotate(-1.5deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.postit h3 { font: 700 24px/1.2 var(--font-head); margin-bottom: 16px; }
.postit ul { columns: 2; column-gap: 24px; list-style: disc; padding-left: 20px; font-weight: 500; }
.postit li { margin-bottom: 6px; break-inside: avoid; }

/* ---------- Home: experience list ---------- */
.xp-list { border-bottom: 1px solid var(--line); }
.xp-row {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.xp-row .period { color: var(--muted); font-size: 15px; }
.xp-row .game { font: 500 22px/1.3 var(--font-head); }
.xp-row .studio { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.xp-row:hover .game { color: var(--cyan); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; }
.site-footer .foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px 32px; flex-wrap: wrap;
}
.site-footer p { color: var(--muted); font-size: 14px; max-width: 640px; }

/* ---------- Projects page ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap; margin-bottom: 40px;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font: 500 15px/1 var(--font-body); cursor: pointer;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); }
.chip[aria-pressed="true"] {
  background: var(--cyan); border-color: var(--cyan);
  color: var(--bg); font-weight: 600;
}
.count { color: var(--muted); font-size: 15px; }

/* ---------- Project pages ---------- */
.back { margin-bottom: 40px; }
.project-head { padding-top: 56px; }
.info {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px 32px; margin: 48px 0;
  padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.info dt {
  font: 600 12px/1.3 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  margin-bottom: 8px;
}
.info dd { color: var(--text); }
.desc { font-size: 18px; color: var(--text-2); max-width: 760px; margin: 0 auto 64px; text-align: center; }
.gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.gallery img {
  display: block; width: 100%; height: auto; margin: 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.gallery .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 96px; border-top: 1px solid var(--line);
}
.pager a { display: block; padding: 32px 0; min-height: 44px; }
.pager .next { text-align: right; }
.pager .dir {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13px/1.3 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.pager .ttl { display: block; font: 500 22px/1.3 var(--font-head); margin-top: 8px; }
.pager a:hover .dir, .pager a:hover .ttl { color: var(--cyan); }

/* ---------- Professional experience page ---------- */
.xp-entries { border-bottom: 1px solid var(--line); }
.xp-entry {
  display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center;
  padding: 48px 0; border-top: 1px solid var(--line);
}
.xp-entry .ph { transition: border-color 0.2s; }
.xp-entry:hover .ph { border-color: var(--cyan); }
.xp-entry .period {
  font: 600 13px/1.3 var(--font-body);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.xp-entry h2 { font: 600 32px/1.15 var(--font-head); margin: 10px 0 6px; }
.xp-entry h2 a:hover { color: var(--cyan); }
.xp-entry .studio { color: var(--cyan); font-weight: 500; margin-bottom: 16px; }
.xp-entry .body { color: var(--text-2); max-width: 560px; margin-bottom: 12px; }

/* ---------- Contact page ---------- */
.contact-card {
  margin-top: 48px; max-width: 720px;
  padding: 44px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.card-label {
  font: 400 13px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted);
  margin-bottom: 16px;
}
.card-email {
  display: inline-block; min-height: 44px;
  font: 700 clamp(26px, 4vw, 40px)/1.2 var(--font-head);
  letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.card-email:hover { color: var(--cyan); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.btn-glow { box-shadow: 0 8px 28px rgba(60, 203, 230, 0.28); }
.social { margin-top: 112px; }
.social .h-section { margin-bottom: 40px; font-size: clamp(28px, 3.5vw, 44px); }
.tiles { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tile {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  min-height: 140px; padding: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.tile:hover { border-color: var(--cyan); }
.tile .name { font: 600 24px/1.2 var(--font-head); }
.tile .handle { margin-top: 8px; color: var(--muted); font-size: 15px; }
.tile:hover .ico { color: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 56px; }
  .about .photo { max-width: 420px; }
  .xp-entry { grid-template-columns: 1fr; gap: 24px; }
  .xp-row { grid-template-columns: 1fr; gap: 6px; }
  .section { padding: 80px 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .brand { font-size: 17px; }
  .site-header nav { gap: 0; }
  .site-header nav a { padding: 0 8px; font-size: 14px; }
  .site-header nav a .long { display: none; }
  .gallery .pair { grid-template-columns: 1fr; }
  .postit ul { columns: 1; }
  .postit { padding: 24px; }
  .pager { grid-template-columns: 1fr; gap: 0; }
  .pager .next { text-align: left; border-top: 1px solid var(--line); }
  .page-head { padding: 64px 0 40px; }
  .xp-entry h2 { font-size: 28px; }
  .contact-card { padding: 28px 24px; }
  .section-head { margin-bottom: 32px; }
}
