/* Supacode — dark showcase site */

@font-face {
  font-family: "EDIX";
  src: url("../fonts/EDIX.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #000;
  --bg-2: #0b0b0d;
  --bg-3: #141417;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --line: rgba(245, 245, 247, 0.12);
  --line-strong: rgba(245, 245, 247, 0.35);
  --accent: #f5f5f7;

  --font-display: "EDIX", "D-DIN", "Barlow", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1280px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--font-mono); }
.dim { color: var(--text-2); }

/* ---------- Type ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin: 0;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow .idx {
  font-family: var(--font-display);
  color: var(--accent);
  margin-right: 10px;
  letter-spacing: 0.08em;
}

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--text); color: #000; border-color: var(--text); }

.btn-solid { background: var(--accent); color: #000; border: 1px solid var(--accent); }
.btn-solid:hover { background: transparent; color: var(--accent); }

.btn-light { background: var(--text); color: #000; text-transform: none; letter-spacing: 0; font-size: 15px; }
.btn-light:hover { background: #fff; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  transition: transform .45s var(--ease), background-color .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav-logo img { height: 15px; width: auto; }

.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle { display: none; width: 40px; height: 40px; position: relative; margin-right: -8px; }
.nav-toggle span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--text);
  transition: transform .35s var(--ease);
}
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-h) var(--gutter);
  gap: 8px;
}
.menu[hidden] { display: none; }
.menu a {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 40px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 18px;
}
.menu-num { font-size: 13px; color: var(--text-3); min-width: 24px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
/* Night-side Earth from the ISS (NASA, iss058e005282, public domain) */
.hero-earth {
  position: absolute; z-index: -1;
  inset: 0;
  pointer-events: none;
}
.hero-earth img {
  position: absolute;
  left: -4vw;
  top: 18vh;
  width: max(110vw, 1100px);
  max-width: none;
  height: auto;
  mix-blend-mode: screen;
  filter: saturate(1.15) brightness(0.8);
  transform-origin: 70% 100%;
  animation: earth-drift 40s ease-in-out infinite alternate;
}
.hero-earth::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 40%, rgba(0,0,0,0) 60%),
    linear-gradient(0deg, #000 0%, rgba(0,0,0,0) 18%);
}
@keyframes earth-drift { to { transform: scale(1.04) translateY(-1%); } }
.hero-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 22vh;
}
.hero-title { font-size: clamp(40px, 11vw, 156px); letter-spacing: 0.03em; }
.hero-lede {
  max-width: 34em;
  margin: 28px 0 0;
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--text-2);
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 12px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px;
  background: var(--text); border-radius: 2px;
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Project sections ---------- */

.project {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 0 96px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  isolation: isolate;
}
.project-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  flex: 1;
  display: flex;
  align-items: center;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.split-reverse .project-copy { order: 2; }

.project-copy { max-width: 600px; min-width: 0; width: 100%; }
.project-title { font-size: clamp(34px, 4.2vw, 60px); }
.project-lede { margin: 24px 0 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--text-2); }

.features { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.features li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
  display: grid; grid-template-columns: 11em 1fr; gap: 16px;
}
.features strong { color: var(--text); font-weight: 600; }


.project-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
  padding: 9px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  overflow: visible;
}

/* SupaLive */
.project-live { background: radial-gradient(80% 60% at 75% 40%, #1a1206 0%, var(--bg) 60%); }
.live-visual { position: relative; display: grid; place-items: center; min-height: 420px; }
.live-glow {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 162, 58, 0.28), transparent 65%);
  filter: blur(20px);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
.live-icon {
  position: relative; width: min(340px, 70%);
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, .8));
  animation: float 8s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px); } }
.live-hud {
  position: absolute; right: 0; bottom: 6%;
  width: min(260px, 70%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 20, 23, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 12px;
}
.live-hud-row { display: flex; justify-content: space-between; align-items: center; }
.live-hud-row + .live-hud-row { margin-top: 6px; }
.rec { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; letter-spacing: .1em; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: #ff453a; animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.live-bars { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: 12px; }
.live-bars i {
  flex: 1; background: var(--accent); border-radius: 1px; opacity: .85;
  animation: bar 1.2s ease-in-out infinite alternate;
}
.live-bars i:nth-child(3n) { animation-delay: -.4s; }
.live-bars i:nth-child(3n+1) { animation-delay: -.8s; }
.live-bars i:nth-child(4n) { animation-duration: .9s; }
@keyframes bar { from { height: 25%; } to { height: 100%; } }

/* Terminal UI */
.project-tui { background: var(--bg); }
.tui-bg { position: absolute; inset: 0; z-index: -1; }
.tui-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; opacity: .75; }
.tui-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #000 0%, rgba(0,0,0,.88) 35%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.2) 100%),
    linear-gradient(0deg, #000 0%, transparent 30%);
}

.terminal {
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
}
.terminal-tabs { display: flex; border-bottom: 1px solid var(--line); }
.terminal-tabs button {
  padding: 10px 16px; color: var(--text-3); font-size: 12px;
  border-right: 1px solid var(--line);
  transition: color .2s, background-color .2s;
}
.terminal-tabs button:hover { color: var(--text); }
.terminal-tabs button[aria-selected="true"] { color: var(--accent); background: rgba(63, 220, 108, 0.08); }
.terminal-body { display: flex; align-items: center; gap: 12px; padding: 16px; }
.terminal-body code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.terminal-body code::-webkit-scrollbar { display: none; }
.prompt { color: var(--accent); }
.caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -0.2em; margin-left: 2px; background: var(--accent); animation: blink 1s steps(2, jump-none) infinite; }
.copy {
  flex: none; padding: 6px 12px; font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--text-2);
  transition: color .2s, border-color .2s;
}
.copy:hover, .copy.done { color: var(--accent); border-color: var(--accent); }

/* SupaCudy */
.project-cudy { background: radial-gradient(70% 60% at 25% 50%, #07102a 0%, var(--bg) 65%); }
.cudy-visual { perspective: 1600px; }
.window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1c1c1f;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(77, 124, 255, .08), 0 30px 120px -40px rgba(77, 124, 255, .45);
  transform: rotateY(14deg) rotateX(4deg);
  transform-origin: left center;
  transition: transform 1s var(--ease);
}
.cudy-visual:hover .window { transform: rotateY(4deg) rotateX(1deg); }
.window-bar { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a3e; }
.window-bar span { margin-left: auto; margin-right: auto; font-size: 11px; color: var(--text-3); transform: translateX(-20px); }

/* ---------- Closing & footer ---------- */

.closing {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  border-top: 1px solid var(--line);
  background: radial-gradient(60% 50% at 50% 100%, #15151a 0%, var(--bg) 70%);
}
.closing-inner { padding: 120px var(--gutter); display: flex; flex-direction: column; align-items: center; }
.closing-title { font-size: clamp(32px, 6vw, 80px); }
.closing .hero-lede { margin-left: auto; margin-right: auto; }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px;
  font-size: 13px; color: var(--text-3);
}
.footer-logo { height: 12px; width: auto; opacity: .8; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer nav a:hover { color: var(--text); }
.footer-copy { margin: 0 0 0 auto; }

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-logo img { height: 12px; }
  .nav-toggle { display: block; }

  .split { grid-template-columns: 1fr; }
  .split-reverse .project-copy { order: 0; }
  .project-copy { max-width: none; }

  .live-visual { min-height: 340px; }
  .window { transform: none; }

  .project-tui .project-inner { align-items: flex-end; }
  .tui-bg { bottom: auto; height: 60%; }
  .tui-bg img { opacity: .6; }
  .tui-bg::after { background: linear-gradient(0deg, #000 0%, rgba(0,0,0,.5) 50%, rgba(0,0,0,.2) 100%); }
  .project-tui { padding-top: 38vh; }

}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .features li { grid-template-columns: 1fr; gap: 2px; }
  .btn { height: 44px; padding: 0 18px; font-size: 13px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .footer-copy { margin-left: 0; width: 100%; }
}
