/* ============================================================
   GRACE — official website
   Near-black, off-white type, restrained electric blue/violet.
   No framework, no dependencies, no build step.
   ============================================================ */

:root {
  --bg: #08080b;
  --bg-2: #0b0b11;
  --bg-3: #101018;

  --text: #ececf1;
  --text-2: #a2a2ae;
  --text-3: #6b6b78;

  --accent: #8b9dff;
  --accent-2: #a78bfa;
  --success: #7ee2a8;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code",
    "JetBrains Mono", Menlo, Consolas, monospace;

  --header-h: 64px;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms var(--ease);
}

a:hover {
  color: #b3c0ff;
}

::selection {
  background: rgba(139, 157, 255, 0.32);
  color: #fff;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: top 160ms var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 720px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(8, 8, 11, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  height: var(--header-h);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.brand img {
  height: 26px;
  width: auto;
  opacity: 0.95;
  transition: opacity 160ms var(--ease);
}

.brand:hover img {
  opacity: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  margin-left: auto;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    color 160ms var(--ease), transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.btn-primary {
  background: #f2f2f5;
  color: #0a0a0c;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: #ffffff;
  color: #0a0a0c;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.7);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn .icon {
  flex: none;
}

.arrow {
  transition: transform 160ms var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 88px) 0 96px;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 460px at 50% 18%, rgba(139, 157, 255, 0.11), transparent 70%),
    radial-gradient(460px 360px at 82% 68%, rgba(167, 139, 250, 0.05), transparent 70%);
  animation: glow-breathe 14s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  width: clamp(130px, 16vw, 172px);
  height: auto;
  filter: drop-shadow(0 0 34px rgba(139, 157, 255, 0.28));
  animation: reveal 900ms var(--ease) both;
}

.hero-title {
  margin: 28px 0 0;
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1.04;
  animation: reveal 900ms var(--ease) 120ms both;
}

.hero-sub {
  margin: 22px 0 0;
  max-width: 560px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.65;
  animation: reveal 900ms var(--ease) 220ms both;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
  animation: reveal 900ms var(--ease) 320ms both;
}

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

/* ---------- Terminal ---------- */

.terminal {
  width: 100%;
  max-width: 860px;
  margin: 72px auto 0;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 48px 96px -48px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  animation: reveal 1000ms var(--ease) 420ms both;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.term-dots {
  display: inline-flex;
  gap: 6px;
}

.term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.term-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.term-body {
  padding: 22px 24px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-x: auto;
}

.t-line {
  white-space: pre;
  min-height: 1.85em;
}

.t-dim   { color: var(--text-3); }
.t-blue  { color: var(--accent); }
.t-green { color: var(--success); }
.t-cmd   { color: var(--text); }

.t-gap {
  min-height: 0.9em;
}

.t-prompt {
  color: var(--accent);
  margin-right: 2px;
}

.t-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* Reveal lines after the typed command (gated on .js) */
html.js .t-reveal {
  opacity: 0;
}

html.js .t-reveal.is-visible {
  animation: line-in 420ms var(--ease) both;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 108px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-sub {
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- Features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 30px 28px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.feature:hover {
  border-color: rgba(139, 157, 255, 0.28);
  background: var(--bg-3);
}

.feature-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 22px;
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ---------- Open source ---------- */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list a {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}

.pill-list a:hover {
  border-color: rgba(139, 157, 255, 0.45);
  color: var(--text);
}

.section-cta {
  margin-top: 44px;
  text-align: center;
}

/* ---------- Install / code blocks ---------- */

.code-list {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.code-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.copy-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 140ms var(--ease), border-color 140ms var(--ease),
    background 140ms var(--ease);
}

.copy-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.04);
}

.copy-btn.is-copied {
  color: var(--success);
  border-color: rgba(126, 226, 168, 0.4);
}

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}

.c-comment {
  color: var(--text-3);
}

.install-note {
  margin: 26px auto 0;
  max-width: 560px;
  text-align: center;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.install-note code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 0;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-brand img {
  width: 46px;
  height: auto;
  margin-bottom: 12px;
  opacity: 0.9;
}

.footer-brand p {
  margin: 0;
  color: var(--text-3);
  font-size: 13.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-2);
  font-size: 13.5px;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 44px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

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

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: calc(var(--header-h) + 64px);
  }

  .terminal {
    margin-top: 56px;
  }
}

@media (max-width: 640px) {
  .container,
  .nav-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section {
    padding: 76px 0;
  }

  .term-body {
    padding: 18px 16px 20px;
    font-size: 12.5px;
  }

  .term-tag {
    display: none;
  }

  .hero-ctas .btn {
    flex: 1 1 100%;
  }

  .footer-inner {
    flex-direction: column;
    gap: 28px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  html.js .t-reveal {
    opacity: 1;
  }
}
