/* ============================================================
   Cooper Ross - personal site
   Sleek, minimal, dark-first. Single accent (maple red).
   ============================================================ */

:root {
  --bg: #0a0b0d;
  --bg-elev: #111317;
  --bg-elev-2: #161920;
  --border: #23262e;
  --border-soft: #272b34;
  --text: #e9eaec;
  --text-dim: #9aa0aa;
  --text-faint: #646a74;
  --accent: #ef4146;          /* maple red */
  --accent-soft: rgba(239, 65, 71, 0.075);
  --accent-2: #ff6b6b;        /* secondary red (terminal / accents) */
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #f7f7f5;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f0ee;
  --border: #e2e2dd;
  --border-soft: #dfdfda;
  --text: #15171a;
  --text-dim: #555b63;
  --text-faint: #8b9098;
  --accent: #e0353a;
  --accent-soft: rgba(224, 53, 59, 0.071);
  --accent-2: #e0353a;
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
  /* scroll-padding-top: 90px; */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }
.muted { color: var(--text-dim); }
strong { color: var(--text); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--accent-2); }

/* ---------- Background FX ---------- */
/* .grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.5;
}
.spotlight {
  position: fixed; width: 1200px; height: 1200px; z-index: -1; pointer-events: none;
  border-radius: 50%; left: 0; top: 0; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 55%);
  transition: opacity 0.3s; opacity: 0;
}
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 100;
  background: linear-gradient(90deg, var(--accent), #ff3d3d);
} */

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 40px);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__brand { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-weight: 700; }
.nav__leaf { font-size: 1.1rem; }
.nav__links { display: flex; gap: 26px; font-size: 0.9rem; }
.nav__links a { color: var(--text-dim); transition: color 0.2s; position: relative; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.25s;
}
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.cmdk-hint {
  display: flex; align-items: center; gap: 3px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 8px; border-radius: 8px; font-family: var(--mono); font-size: 0.72rem;
  transition: border-color 0.2s, color 0.2s;
}
.cmdk-hint:hover { border-color: var(--accent); color: var(--text); }
kbd {
  font-family: var(--mono); font-size: 0.72rem; background: var(--bg-elev-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text-dim);
}
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 34px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.theme-toggle ion-icon { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.cmdk-hint ion-icon { width: 14px; height: 14px; color: var(--text-faint); }
.section__more ion-icon { width: 14px; height: 14px; vertical-align: -2px; }
.pcard__links a ion-icon { width: 14px; height: 14px; }
.footer__links a { display: inline-flex; align-items: center; gap: 6px; }
.footer__links a ion-icon { width: 16px; height: 16px; }
.palette__item .pi-ico { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.section { padding: clamp(34px, 4.5vw, 58px) 0; }
.section__head {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.section__index { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.section__title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
.section__more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim); }
.section__more:not(.muted):hover { color: var(--accent); }


/* ---------- Hero (full-bleed background, aligned content) ---------- */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-bottom: 1px solid var(--border);
  background: radial-gradient(1100px 380px at 20% -20%, var(--accent-soft), transparent 60%);
}
.hero__inner {
  display: block; width: 100%;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(82px, 11vh, 108px) clamp(16px, 4vw, 40px) clamp(28px, 4vh, 46px);
}
.hero__left { max-width: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,65,70,.5);} 70%{box-shadow:0 0 0 8px rgba(239,65,70,0);} 100%{box-shadow:0 0 0 0 rgba(239,65,70,0);} }
.hero__title { font-size: clamp(2.4rem, 6.5vw, 4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 12px; margin-top: 12px; }
.hero__role { font-family: var(--mono); font-size: clamp(0.95rem, 2.5vw, 1.2rem); color: var(--text-dim); margin-bottom: 16px; min-height: 1.6em; }
.hero__role .prompt { color: var(--accent-2); margin-right: 8px; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__bio { max-width: 70ch; color: var(--text-dim); margin-bottom: 22px; font-size: 1rem; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn { padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; transition: transform 0.15s, box-shadow 0.2s, background 0.2s; border: 1px solid transparent; cursor: pointer; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--accent); }
.btn--ghost { background: var(--bg-elev); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; }
.about__text p { color: var(--text-dim); margin-bottom: 14px; max-width: 68ch; }
.about__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { cursor: pointer; font-family: var(--mono); font-size: 0.76rem; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); background: var(--bg-elev); transition: border-color .2s, color .2s, transform .2s; }
.chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.about__card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; height: fit-content; }
.about__card h3 { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.ticks { list-style: none; }
.ticks li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; color: var(--text-dim); font-size: 0.92rem; }
.ticks li ion-icon { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.ticks a { color: var(--text); border-bottom: 1px solid var(--accent); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pcard { position: relative; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 9px; transition: transform .25s, border-color .25s, box-shadow .25s; overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx,50%) var(--my,0%), var(--accent-soft), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.pcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.pcard:hover::before { opacity: 1; }
.pcard--featured { grid-column: span 1; }
.pcard__top { display: flex; align-items: center; justify-content: space-between; }
.pcard__name { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pcard__tagline { color: var(--accent); font-size: 0.8rem; font-family: var(--mono); }
.pcard__desc { color: var(--text-dim); font-size: 0.86rem; flex: 1; }
.pcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--mono); font-size: 0.7rem; color: var(--text-faint); padding: 3px 8px; border: 1px solid var(--border-soft); border-radius: 6px; }
.pcard__links { display: flex; gap: 14px; font-family: var(--mono); font-size: 0.82rem; margin-top: 4px; }
.pcard__links a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-dim); transition: color .2s; }
.pcard__links a:hover { color: var(--accent); }

/* ---------- Terminal ---------- */
.terminal { position: relative; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--bg-elev-2); border-bottom: 1px solid var(--border); }
.tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot--r { background: #ff5f56; } .tdot--y { background: #ffbd2e; } .tdot--g { background: #27c93f; }
.terminal__title { margin-left: 10px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); }
.terminal__body { font-family: var(--mono); font-size: 0.86rem; padding: 16px; height: 480px; overflow-y: auto; line-height: 1.6; }
.terminal__body:focus { outline: none; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-cmd { color: var(--text); }
.term-cmd .prompt { color: var(--accent-2); }
.term-out { color: var(--text-dim); }
.term-out b { color: var(--accent-2); font-weight: 500; }
.term-out a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.term-err { color: var(--accent); }
.terminal__input { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.88rem; }
.terminal__input .prompt { color: var(--accent-2); white-space: nowrap; }
#term-input { flex: 1; background: none; border: none; color: var(--text); font-family: var(--mono); font-size: 0.88rem; outline: none; }

/* ---------- vim editor (overlay) ---------- */
.vim-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.6;
  z-index: 10;
}
.vim-screen { flex: 1; overflow: hidden; padding: 6px 10px; }
.vim-line { white-space: pre; min-height: 1.6em; color: var(--text); }
.vim-tilde { color: var(--text-faint); }
.vim-cursor { background: var(--accent); color: var(--bg); }
.vim-caret {
  display: inline-block; width: 0; height: 1.05em; margin: 0 -1px;
  border-left: 2px solid var(--accent); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
.vim-status {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 3px 10px; border-top: 1px solid var(--border);
  background: var(--bg-elev-2); font-size: 0.8rem; color: var(--text-dim);
}
.vim-status__left { font-weight: 600; color: var(--text); white-space: pre; }
.vim-status__right { color: var(--text-faint); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 20px 0 30px; text-align: center; }
.footer__cta { font-size: clamp(1.7rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 22px; }
.footer__links { display: flex; gap: 26px; justify-content: center; font-family: var(--mono); margin-bottom: 22px; flex-wrap: wrap; }
.footer__links a { color: var(--text-dim); position: relative; }
.footer__links a:hover { color: var(--accent); }
.footer__fine { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.palette__panel { position: relative; width: min(560px, 92vw); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.palette__input { width: 100%; padding: 18px 20px; background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); font-size: 1rem; font-family: var(--sans); outline: none; }
.palette__list { list-style: none; max-height: 320px; overflow-y: auto; padding: 8px; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px; cursor: pointer; color: var(--text-dim); font-size: 0.92rem; }
.palette__item.active, .palette__item:hover { background: var(--bg-elev-2); color: var(--text); }
.palette__item .pi-hint { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); }
.palette__foot { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.74rem; color: var(--text-faint); font-family: var(--mono); }

/* ---------- Reveal anim ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .projects { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav__links { display: none; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero__cta { flex-direction: column; }
  .btn { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
