/* ============================================================
   CORVUS FORGE — Design System & Stylesheet
   Crafted with Semantic CSS · Dark Obsidian & Molten Amber
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --bg:          #050507;
  --bg-surface:  #0a0b10;
  --text-main:   #f5f5f7;
  --text-muted:  #86868b;
  --text-dim:    #48484a;
  --accent:      #ff6b00;
  --accent-glow: rgba(255, 107, 0, 0.2);
  --border:      rgba(255, 255, 255, 0.07);
  --border-h:    rgba(255, 255, 255, 0.15);

  --font-main:   'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:  'Instrument Serif', Georgia, serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Global Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Film grain noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #22232a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Common Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 5vw, 4rem);
}

/* Reveal Transitions */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
  will-change: transform, opacity;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* WebGL Background Canvas */
.smoke-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   NAVIGATION BAR — Compact Snug Floating Pill
   ============================================================ */
.nav {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 1.15rem;
  padding: 0.35rem 0.55rem 0.35rem 1.15rem;
  background: rgba(9, 10, 14, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 100px;
  width: auto;
  max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: top 0.3s var(--ease-out), background 0.3s var(--ease-out), border-color 0.3s;
}

.nav.scrolled {
  top: 14px;
  background: rgba(9, 10, 14, 0.92);
  border-color: var(--border-h);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 1.15rem;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s var(--ease-out);
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #14151b;
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease-out), border-color 0.25s;
  flex-shrink: 0;
}

.nav-logo:hover {
  transform: scale(1.08);
  border-color: var(--border-h);
}

.nav-logo img {
  filter: brightness(0) invert(1);
}

.nav-cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 0.45rem 1.05rem;
  border-radius: 100px;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  white-space: nowrap;
}

.nav-cta:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-h);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  font-weight: 600;
  transition: transform 0.2s var(--ease-out), opacity 0.25s, background 0.25s, border-color 0.25s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-solid {
  background: #ffffff;
  color: #050507;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.btn-solid:hover {
  opacity: 0.92;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-h);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
  background: #050507;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(5, 5, 7, 0.5) 60%, rgba(5, 5, 7, 0.95) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.035em;
  margin-bottom: 1.8rem;
  animation: hero-appear 1.4s var(--ease-out) forwards;
}

.hero h1 em,
.work h2 em,
.contact h2 em {
  font-family: var(--font-serif);
  font-size: 1.14em;
  font-weight: 400;
  font-style: italic;
  padding-right: 0.08em;
}

.hero-desc {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 2.4rem;
  animation: hero-appear 1.4s var(--ease-out) 0.15s forwards;
  opacity: 0;
}

.hero-cta {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: center;
  animation: hero-appear 1.4s var(--ease-out) 0.3s forwards;
  opacity: 0;
}

@keyframes hero-appear {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   WORK SECTION
   ============================================================ */
.work {
  position: relative;
  padding: 8rem 0 10rem;
  background: #040406;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.work::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 2;
}

.section-head {
  position: relative;
  z-index: 3;
  margin-bottom: 4.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.section-head h2 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.projects-list {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10rem;
}

.project-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-header {
  max-width: 700px;
  text-align: center;
  margin-bottom: 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.project-header h3 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.project-header h3 a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.25s;
}

.project-header h3 a:hover {
  color: var(--text-muted);
}

.arrow {
  color: var(--accent);
  font-size: 0.75em;
  transition: transform 0.3s var(--ease-out);
}

.project-header h3 a:hover .arrow {
  transform: translate(4px, -4px);
}

.project-header p {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 520px;
}

/* MacBook Frame Component */
.macbook-device {
  width: 100%;
  max-width: 1200px;
  perspective: 1600px;
  transform-style: preserve-3d;
  will-change: transform;
}

.macbook-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #040507;
  border-radius: 16px 16px 2px 2px;
  border: 9px solid #14151b;
  border-bottom: 2px solid #14151b;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.macbook-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: rgba(6, 7, 10, 0.95);
  backdrop-filter: blur(15px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.apple-icon { color: #ffffff; }

.camera-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 14px;
  background: #040507;
  border-radius: 0 0 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lens {
  width: 4px;
  height: 4px;
  background: #0a0b10;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.bar-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
}

.macbook-screen {
  position: relative;
  width: 100%;
  height: 100%;
  padding-top: 26px;
  overflow: hidden;
  background: #030305;
}

.screen-scroll {
  position: relative;
  width: 100%;
  will-change: transform;
}

.screen-scroll img {
  width: 100%;
  height: auto;
}

.macbook-chin {
  width: 104%;
  margin-left: -2%;
  height: 10px;
  background: linear-gradient(180deg, #22232c 0%, #111216 100%);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: center;
}

.chin-notch {
  width: 90px;
  height: 3px;
  background: #040507;
  border-radius: 0 0 4px 4px;
}

/* ============================================================
   CONTACT & FOOTER
   ============================================================ */
.contact {
  position: relative;
  min-height: 90svh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #050507;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.contact::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(5, 5, 7, 0.6) 60%, rgba(5, 5, 7, 0.95) 100%);
  pointer-events: none;
  z-index: 2;
}

.contact-box {
  position: relative;
  z-index: 3;
  max-width: 800px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.contact h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 2.2rem;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 4rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.25s;
}

.social-links a:hover {
  color: var(--accent);
}

.sep {
  color: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.legal-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2.5rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.25);
}

.legal-bar a {
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.25s;
}

.legal-bar a:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================
   CURSOR GLOW EFFECT
   ============================================================ */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(200, 210, 220, 0.045) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: left, top;
}

@media (max-width: 768px) {
  .cursor-glow { display: none; }
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 600px;
  width: calc(100vw - 32px);
  padding: 0.9rem 1.4rem;
  background: rgba(12, 12, 15, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.cookie-banner.cookie-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cookie-banner p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.cookie-banner a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-cookie {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  transition: opacity 0.25s, transform 0.2s;
}

.btn-cookie:hover { transform: translateY(-1px); }

.btn-cookie.accept {
  background: #ffffff;
  color: #050507;
}

.btn-cookie.decline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-page {
  min-height: 100svh;
  background: #050507;
  padding: 7rem 0 5rem;
}

.legal-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  color: var(--text-muted);
}

.legal-back {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  transition: color 0.25s;
}

.legal-back:hover { color: var(--text-main); }

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

.legal-page section { margin-bottom: 2.5rem; }

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.7rem;
}

.legal-page p {
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-page ul {
  list-style: none;
  padding: 0;
}

.legal-page li {
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.7;
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.legal-page li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.legal-page a {
  color: var(--accent);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
  .nav {
    top: 14px;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    gap: 0.85rem;
  }

  .nav-link {
    font-size: 0.76rem;
  }

  .nav-cta {
    font-size: 0.74rem;
    padding: 0.35rem 0.85rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .work {
    padding: 5rem 0 4rem;
  }

  .projects-list {
    gap: 6rem;
  }

  .macbook-frame {
    border-width: 6px;
    border-radius: 10px 10px 2px 2px;
  }

  .macbook-topbar {
    height: 20px;
    font-size: 0.58rem;
    padding: 0 0.5rem;
  }

  .camera-notch {
    width: 80px;
    height: 11px;
  }

  .macbook-screen {
    padding-top: 20px;
  }

  .macbook-chin {
    height: 7px;
  }

  .cookie-banner {
    flex-direction: column;
    border-radius: 18px;
    gap: 0.8rem;
    padding: 1.1rem 1.3rem;
  }
}