/* ============================================================
   CodeLine — Design System
   "Compiler ticket" neobrutalism: dark ink background, chunky
   hard-edged cards, hazard-stripe signature, highlighter yellow
   + hot pink accents. No blur, no soft glow — flat & tactile.
   ============================================================ */

:root{
  /* --- surfaces --- */
  --bg:        #101014;
  --bg-alt:    #17171d;
  --surface:   #1c1c24;
  --surface-2: #23232d;
  --raised:    #292933;

  /* --- ink --- */
  --ink:       #f3f0e6;
  --ink-dim:   #cfcdc4;
  --muted:     #93909e;
  --line:      #38363f;
  --line-soft: #2a2932;

  /* --- signature accents --- */
  --accent:      #ffd400; /* highlighter yellow */
  --accent-ink:  #101014; /* text on accent */
  --accent-2:    #ff3d6e; /* hot pink */
  --accent-2-ink:#101014;
  --info:        #5fb3ff;

  /* --- semantic (used only for actual states, not brand) --- */
  --ok:    #35d07f;
  --err:   #ff5a5a;
  --warn:  #ffb020;

  /* --- shape --- */
  --radius: 10px;
  --border: 2px solid var(--line);
  --border-strong: 2.5px solid var(--ink);
  --shadow-hard: 5px 5px 0 var(--accent);
  --shadow-hard-pink: 5px 5px 0 var(--accent-2);
  --shadow-hard-sm: 3px 3px 0 var(--accent);

  --font-display: 'Space Grotesk', 'Archivo Black', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Roboto Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --max-width: 1180px;
  --header-h: 68px;
}

/* ---------- reset ---------- */
*,*::before,*::after{ box-sizing:border-box; }
*{ margin:0; padding:0; }
html{ color-scheme: dark; }
html,body{ height:100%; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img{ display:block; max-width:100%; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }
::selection{ background: var(--accent); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

.container{ max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---------- hazard strip (signature element) ---------- */
.hazard{
  height: 7px;
  background-image: repeating-linear-gradient(-45deg, var(--accent) 0 14px, #1a1a1f 14px 28px);
}

/* ---------- typography ---------- */
h1,h2,h3,h4{ font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.01em; }
h1{ font-size: clamp(30px, 5vw, 54px); font-weight: 700; text-transform: uppercase; }
h2{ font-size: clamp(22px, 3vw, 32px); font-weight: 700; text-transform: uppercase; }
h3{ font-size: 18px; font-weight: 700; }
.eyebrow{ font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display:inline-flex; align-items:center; gap:8px; }
.muted{ color: var(--muted); }
.lead{ color: var(--ink-dim); font-size: 16px; }
code, .mono{ font-family: var(--font-mono); }

/* ---------- buttons (tactile / press-down) ---------- */
.btn{
  display: inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px;
  padding: 12px 20px; border-radius: 8px; cursor: pointer;
  border: 2.5px solid var(--ink); background: var(--surface); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active{ transform: translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; box-shadow: 4px 4px 0 var(--ink); }

.btn-accent{ background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-pink{ background: var(--accent-2); color: #fff; border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-ghost{ background: transparent; }
.btn-sm{ padding: 8px 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.btn-sm:hover{ box-shadow: 4px 4px 0 var(--ink); }
.btn-sm:active{ box-shadow: 0 0 0 var(--ink); }
.btn-block{ width: 100%; }
.btn[aria-busy="true"]{ opacity:.75; cursor:progress; }
.btn-icon{ width:40px; height:40px; padding:0; flex:0 0 auto; }

/* ---------- cards / surfaces ---------- */
.card{
  background: var(--surface);
  border: var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 22px;
}
.card-pink{ box-shadow: var(--shadow-hard-pink); }
.tag{
  display:inline-flex; align-items:center; gap:6px; font-family: var(--font-mono);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 9px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--muted);
}
.tag-accent{ border-color: var(--accent); color: var(--accent); }
.tag-pink{ border-color: var(--accent-2); color: var(--accent-2); }
.tag-ok{ border-color: var(--ok); color: var(--ok); }

/* ---------- header / nav (shared across all pages via site.js) ---------- */
.site-header{
  position: sticky; top: 0; z-index: 500;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: var(--bg); border-bottom: var(--border-strong);
}
.site-header .brand{ display:flex; align-items:center; gap:10px; font-family: var(--font-display); font-weight:700; font-size: 19px; text-transform: uppercase; letter-spacing: -0.01em; }
.site-header .brand .brace{ color: var(--accent); font-family: var(--font-mono); font-size: 22px; }
.site-nav{ display:flex; align-items:center; gap: 4px; }
.site-nav a{
  padding: 9px 13px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-dim);
  border: 2px solid transparent;
}
.site-nav a:hover{ color: var(--ink); background: var(--surface); border-color: var(--line); }
.site-nav a.is-active{ color: var(--accent-ink); background: var(--accent); border-color: var(--ink); }
.site-actions{ display:flex; align-items:center; gap:10px; }
.nav-toggle{
  display:none; width:42px; height:42px; border:2.5px solid var(--ink); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor:pointer; align-items:center; justify-content:center; font-size: 18px;
}

@media (max-width: 900px){
  .site-nav{
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 480;
    background: var(--bg); flex-direction: column; align-items: stretch; gap: 6px; padding: 16px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events:none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    border-top: var(--border);
  }
  .site-nav.open{ opacity:1; visibility:visible; pointer-events:auto; transform:none; }
  .site-nav a{ padding: 14px 16px; font-size: 16px; }
  .nav-toggle{ display:inline-flex; }
}

/* ---------- footer ---------- */
.site-footer{ border-top: var(--border-strong); margin-top: 64px; }
.site-footer .container{ padding: 40px 20px 28px; display:grid; gap: 28px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.site-footer h4{ font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.site-footer ul{ list-style:none; display:flex; flex-direction:column; gap:8px; }
.site-footer a{ color: var(--ink-dim); font-size: 14px; }
.site-footer a:hover{ color: var(--accent); }
.site-footer .bottom{ border-top: var(--border); padding: 16px 20px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; color: var(--muted); font-size:13px; font-family: var(--font-mono); }
@media (max-width: 760px){ .site-footer .container{ grid-template-columns: 1fr 1fr; } }

/* ---------- forms ---------- */
.field{ margin-bottom: 16px; }
.field label{ display:block; font-size: 13px; font-weight:700; margin-bottom:7px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .03em; }
.input, select.input, textarea.input{
  width: 100%; padding: 12px 14px; border-radius: 8px; font-size: 15px;
  background: var(--bg-alt); color: var(--ink); border: 2px solid var(--line);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder{ color: var(--muted); }
.input:focus{ border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.field .error{ color: var(--err); font-size: 12.5px; margin-top: 6px; font-weight:600; }
.field-row{ display:flex; gap: 8px; align-items: center; }
.pw-wrap{ position: relative; }
.pw-wrap .input{ padding-right: 46px; }
.pw-toggle{ position:absolute; right:8px; top:50%; transform:translateY(-50%); background:transparent; border:none; color:var(--muted); cursor:pointer; padding:6px; }
.checkbox-row{ display:flex; align-items:center; gap:8px; font-size: 13.5px; color: var(--ink-dim); }
.checkbox-row input{ accent-color: var(--accent); width:16px; height:16px; }

/* ---------- toast ---------- */
.toast-stack{ position: fixed; left:50%; bottom: 22px; transform: translateX(-50%); z-index: 4000; display:flex; flex-direction:column; gap: 10px; width: min(92vw, 420px); }
.toast{
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: 8px; padding: 12px 14px;
  box-shadow: 4px 4px 0 var(--accent); display:flex; gap: 10px; align-items:flex-start;
  animation: toastIn .2s ease;
}
.toast.err{ box-shadow: 4px 4px 0 var(--err); }
.toast.ok{ box-shadow: 4px 4px 0 var(--ok); }
.toast .t-title{ font-weight:700; font-size: 14px; }
.toast .t-msg{ font-size: 13px; color: var(--ink-dim); }
.toast .t-close{ margin-left:auto; background:transparent; border:none; color:var(--muted); cursor:pointer; font-size:16px; }
@keyframes toastIn{ from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform:none; } }

/* ---------- modal ---------- */
.modal-backdrop{ position: fixed; inset:0; background: rgba(8,8,10,.72); z-index: 3000; display:none; align-items:center; justify-content:center; padding: 20px; }
.modal-backdrop.show{ display:flex; }
.modal-box{ width: 100%; max-width: 460px; background: var(--surface); border: var(--border-strong); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--accent); padding: 22px; }
.modal-box.wide{ max-width: 680px; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom: 14px; gap: 10px; }
.modal-head h3{ text-transform:uppercase; }
.modal-close{ background: transparent; border: 2px solid var(--line); color: var(--ink); width:32px; height:32px; border-radius:7px; cursor:pointer; }

/* ---------- misc ---------- */
.divider{ height: 2px; background: var(--line); border:none; margin: 28px 0; }
.skip-link{ position:absolute; left:12px; top:-60px; background: var(--accent); color: var(--accent-ink); padding:10px 14px; border-radius:8px; font-weight:700; z-index:5000; transition: top .15s; }
.skip-link:focus{ top:12px; }
.spinner{ width:16px; height:16px; border-radius:50%; border:3px solid rgba(255,255,255,.25); border-top-color: currentColor; animation: spin .7s linear infinite; display:inline-block; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.badge-owner{ background: var(--accent-2); color:#fff; font-family: var(--font-mono); font-size:10.5px; text-transform:uppercase; padding:3px 8px; border-radius:999px; letter-spacing:.05em; }
.brace-bg{ position:absolute; font-family: var(--font-mono); font-weight:700; color: var(--surface-2); pointer-events:none; user-select:none; z-index:0; }

.section{ padding: 64px 0; }
.section-sm{ padding: 40px 0; }
.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4{ display:grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 860px){ .grid-2,.grid-3,.grid-4{ grid-template-columns: 1fr; } }

.g-btn{ display:inline-flex; align-items:center; gap:10px; padding: 11px 18px; border-radius:8px; background:#fff; color:#1f1f1f; border:2.5px solid var(--ink); font-weight:700; box-shadow:4px 4px 0 var(--ink); cursor:pointer; font-size:14px; }
.g-btn:hover{ transform: translate(-1px,-1px); box-shadow:5px 5px 0 var(--ink); }
.g-btn:active{ transform: translate(3px,3px); box-shadow:0 0 0 var(--ink); }
.or-row{ display:flex; align-items:center; gap:12px; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.08em; margin: 16px 0; font-family: var(--font-mono); }
.or-row::before,.or-row::after{ content:''; height:2px; flex:1; background: var(--line); }
