@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #000000;
  --fg: #ffffff;
  --fg-2: #a1a1a6;
  --fg-3: #5c5c63;
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(255, 255, 255, 0.25);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Subtle scanline effect */
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 4px;
}

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

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 48px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-brand { display: flex; align-items: center; text-decoration: none; }
.nav-brand img { height: 32px; width: auto; filter: grayscale(100%) contrast(120%); }

.nav-links { display: flex; gap: 40px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-2); text-decoration: none;
  transition: color 300ms var(--ease);
}
.nav-links a:hover { color: var(--fg); }

/* ---------- LAYOUT ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
main { padding-top: 100px; }

/* ---------- HERO SECTION ---------- */
.hero { padding: 160px 0 120px; border-bottom: 1px solid var(--line); }
.hero-kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 32px;
  display: flex; align-items: center; gap: 12px;
}
.hero-kicker::before { content: ''; display: block; width: 8px; height: 8px; background: var(--fg); }
.hero h1 {
  font-family: var(--serif); font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.9; letter-spacing: -0.03em; font-weight: 400;
  color: var(--fg); max-width: 15ch; margin-bottom: 40px;
}
.hero h1 em { font-style: italic; color: var(--fg-2); }
.hero-sub {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  align-items: start; margin-top: 60px; padding-top: 40px;
  border-top: 1px solid var(--line);
}
.hero-sub p { color: var(--fg-2); font-size: 18px; line-height: 1.6; max-width: 50ch; }
.hero-actions { display: flex; gap: 16px; justify-content: flex-end; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 32px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  text-decoration: none; border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg);
  transition: all 300ms var(--ease); cursor: pointer;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-bright); }
.btn-ghost:hover { border-color: var(--fg); }

/* ---------- SECTIONS & ROWS ---------- */
section { padding: 120px 0; border-bottom: 1px solid var(--line); }
.section-rule {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 24px; border-bottom: 1px solid var(--fg);
  margin-bottom: 64px;
}
.section-rule .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--fg); }
.section-rule .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--fg-3); }

.section-title {
  font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -0.02em;
  max-width: 25ch; margin-bottom: 80px; color: var(--fg);
}
.section-title em { font-style: italic; color: var(--fg-2); }

.row {
  display: grid; grid-template-columns: 100px 1fr 1.5fr; gap: 48px;
  padding: 40px 0; border-bottom: 1px solid var(--line);
  transition: background 300ms var(--ease);
}
.row:hover { background: rgba(255,255,255,0.02); }
.row-num { font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.row-title { font-family: var(--serif); font-size: 2.5rem; line-height: 1; color: var(--fg); }
.row-body { color: var(--fg-2); font-size: 16px; line-height: 1.6; max-width: 60ch; }

/* ---------- FORMS & AUTH PAGES ---------- */
.form-wrap {
  max-width: 500px; margin: 100px auto; padding: 48px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.5);
}
.form-wrap h1 { font-family: var(--serif); font-size: 3.5rem; margin-bottom: 16px; line-height: 1; }
.form-wrap > p { color: var(--fg-2); margin-bottom: 40px; font-size: 15px; }
.field { margin-bottom: 24px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 12px; }
.field input, .field select {
  width: 100%; padding: 16px; background: transparent;
  border: 1px solid var(--line-bright); color: var(--fg);
  font-family: var(--sans); font-size: 16px; transition: border 300ms var(--ease);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--fg); }
.field input.code-input { font-family: var(--mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; }
.btn-full { width: 100%; padding: 18px; }

.msg { padding: 16px; margin-top: 24px; font-family: var(--mono); font-size: 12px; border: 1px solid transparent; }
.msg.err { border-color: #ff4444; color: #ff4444; background: rgba(255, 68, 68, 0.05); }
.msg.ok { border-color: #00ff00; color: #00ff00; background: rgba(0, 255, 0, 0.05); }

/* ---------- FOOTER ---------- */
footer { padding: 80px 0 40px; border-top: 1px solid var(--line); background: #050505; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.footer-brand img { height: 24px; filter: grayscale(100%); }
.footer-links { display: flex; gap: 32px; }
.footer-links a { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--fg-3); text-decoration: none; transition: color 300ms var(--ease); }
.footer-links a:hover { color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--fg-3); }

/* ---------- REVEAL ANIMATIONS ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- MOBILE RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav { padding: 16px 24px; }
  .nav-brand img { height: 28px; }
  
  /* Fix the Nav Links for Mobile */
  .nav-links { 
    display: flex; 
    gap: 16px; 
    overflow-x: auto; /* Allows scrolling if there are too many links */
    white-space: nowrap;
  }
  .nav-links a { font-size: 10px; }
  .nav-links button { font-size: 10px; padding: 6px 10px; }

  .container { padding: 0 24px; }
  
  /* Fix Hero Text */
  .hero { padding: 100px 0 60px; }
  .hero h1 { font-size: 3.5rem; line-height: 1; }
  .hero-sub { grid-template-columns: 1fr; gap: 32px; }
  .hero-actions { justify-content: flex-start; }

  /* Fix Layouts */
  section { padding: 60px 0; }
  .section-title { font-size: 2.5rem; margin-bottom: 40px; }
  .row { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .row-num { padding-top: 0; }
  .row-title { font-size: 1.8rem; }

  /* Fix Forms (Login, Access, Reset) */
  .form-wrap { margin: 40px auto; padding: 32px 24px; }
  .form-wrap h1 { font-size: 2.5rem; }

  /* Fix Dashboard */
  .dash-grid { grid-template-columns: 1fr; }
  .dash-header h1 { font-size: 3rem; }

  /* Fix Admin Panel */
  .admin-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 600px) {
  /* Make sure the nav links don't break the screen */
  .nav { flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 20px; }
  .nav-links { width: 100%; justify-content: space-between; }
  .hero h1 { font-size: 2.8rem; }
}