:root {
  --accent-color: #5ea4ff;
  --accent-soft: rgba(94, 164, 255, 0.13);
  --accent-bright: #6aaeff;
  --accent-cyan: #3fd0ff;
  --code-green: #7ee2b8;
  --code-amber: #ffc66d;
  --code-pink: #ff8fc7;
  --panel-bg: rgba(10, 17, 31, 0.88);
  --panel-bar: rgba(18, 28, 48, 0.95);
  --panel-border: rgba(94, 164, 255, 0.18);
  --tile-bg: rgba(3, 7, 14, 0.6);
  --icon-ring: rgba(63, 208, 255, 0.28);
  --link-glow: rgba(94, 164, 255, 0.45);
  --glow: rgba(63, 208, 255, 0.16);
  --grid-line: rgba(94, 164, 255, 0.05);
  --kbd-bg: linear-gradient(180deg, rgba(40, 56, 86, 0.9), rgba(20, 30, 50, 0.95));
  --kbd-border: rgba(130, 170, 230, 0.28);
  --kbd-edge: rgba(0, 0, 0, 0.55);
  --kbd-text: #d6e4ff;
  --tint-color: #060a14;
  --bg-gradient:
    radial-gradient(ellipse 70% 45% at 78% 8%, rgba(32, 99, 224, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 55%, rgba(63, 208, 255, 0.08), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    #060a14;
  --text-color: #eef4ff;
  --muted-text: #a9b7cf;
  --selection-bg: rgba(63, 208, 255, 0.32);
  --selection-text: #f5faff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(63, 208, 255, 0.07);
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --accent-color: #1d5fd8;
    --accent-soft: rgba(32, 99, 224, 0.1);
    --accent-bright: #1a56c8;
    --accent-cyan: #0a7fae;
    --tint-color: #eaf1ff;
    --grid-line: rgba(32, 99, 224, 0.07);
    --glow: rgba(32, 99, 224, 0.1);
    --bg-gradient:
      radial-gradient(ellipse 70% 45% at 78% 8%, rgba(32, 99, 224, 0.14), transparent 70%),
      radial-gradient(ellipse 50% 40% at 0% 55%, rgba(51, 184, 240, 0.1), transparent 70%),
      linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
      #eaf1ff;
    --text-color: #0d1a33;
    --muted-text: #43526c;
    --selection-bg: rgba(32, 99, 224, 0.22);
    --selection-text: #0d1a33;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-bar: rgba(226, 235, 252, 0.95);
    --panel-border: rgba(32, 99, 224, 0.18);
    --tile-bg: rgba(240, 245, 255, 0.95);
    --link-glow: rgba(32, 99, 224, 0.3);
    --kbd-bg: linear-gradient(180deg, #ffffff, #e6edfa);
    --kbd-border: rgba(32, 70, 140, 0.25);
    --kbd-edge: rgba(32, 70, 140, 0.22);
    --kbd-text: #1b2b4a;
    --shadow: 0 20px 50px rgba(26, 79, 191, 0.16);
  }
}

/* Code window stays dark in both schemes, like a real editor. */
.hero-panel,
.terminal {
  --text-color: #eef4ff;
  --muted-text: #a9b7cf;
  --accent-bright: #6aaeff;
  --panel-bg: rgba(10, 17, 31, 0.96);
  --panel-bar: rgba(18, 28, 48, 1);
  --panel-border: rgba(94, 164, 255, 0.2);
  --tile-bg: rgba(3, 7, 14, 0.65);
  --accent-soft: rgba(94, 164, 255, 0.15);
  --kbd-text: #d6e4ff;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-gradient);
  background-color: var(--tint-color);
  color: var(--text-color);
}

body {
  padding: 0;
}

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

.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  box-sizing: border-box;
  animation: fadeInUp 0.55s ease-out;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem 1rem 1.6rem;
  }
}

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

.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--panel-border);
}

.header > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-prompt {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted-text);
}

.header-prompt .kbd:first-child {
  margin-left: 0.4rem;
}

@media (max-width: 560px) {
  .header-prompt {
    display: none;
  }
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--icon-ring),
    0 0 22px var(--glow),
    0 10px 24px rgba(0, 0, 0, 0.45);
  -webkit-user-drag: none;
}

h1 {
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0;
  color: var(--text-color);
  letter-spacing: 0;
}

.tagline {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  opacity: 1;
}

.tagline::before {
  content: "// ";
  opacity: 0.6;
}

.underline-accent {
  display: none;
}

/* ---------- Keycaps ---------- */

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.42em;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid var(--kbd-border);
  border-bottom-width: 3px;
  border-bottom-color: var(--kbd-edge);
  background: var(--kbd-bg);
  color: var(--kbd-text);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 3rem;
  padding: 4rem 0 3rem;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-kicker::before {
  content: "$ ";
  color: var(--accent-cyan);
}

.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-size: clamp(2.4rem, 10vw, 4.4rem);
  white-space: nowrap;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-color);
  text-shadow: 0 0 40px var(--glow);
  overflow-wrap: anywhere;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.82em;
  margin-left: 0.08em;
  vertical-align: -0.06em;
  background: var(--accent-cyan);
  box-shadow: 0 0 18px var(--glow);
  animation: blink 1.1s steps(1) infinite;
}

.hero-lede {
  font-size: 1.08rem;
  max-width: 34rem;
}

.hero-note {
  max-width: 34rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent-cyan);
  color: var(--text-color);
}

/* Code window */

.hero-panel {
  position: relative;
  display: grid;
  gap: 0.7rem;
  padding: 0 0 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 80%;
  background: radial-gradient(circle, rgba(63, 208, 255, 0.12), transparent 65%);
  pointer-events: none;
}

.hero-panel > .panel-row,
.hero-panel > .panel-code {
  margin: 0 1rem;
}

.window-bar,
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  background: var(--panel-bar);
  border-bottom: 1px solid var(--panel-border);
}

.dots {
  display: inline-flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

.window-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-tabs {
  display: flex;
  gap: 0.25rem;
  margin: -0.7rem 0 0;
  padding: 0 0.6rem;
  background: var(--panel-bar);
  border-bottom: 1px solid var(--panel-border);
}

.tab {
  padding: 0.45rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted-text);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--text-color);
  border-bottom-color: var(--accent-cyan);
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--tile-bg);
}

.panel-name {
  color: var(--text-color);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel-meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted-text);
  font-size: 0.8rem;
}

.panel-tag {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--kbd-border);
  border-bottom: 3px solid rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(40, 56, 86, 0.9), rgba(20, 30, 50, 0.95));
  color: var(--kbd-text);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
}

.panel-tag.accent {
  border-color: rgba(126, 226, 184, 0.4);
  border-bottom-color: rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(40, 90, 76, 0.85), rgba(18, 48, 42, 0.95));
  color: var(--code-green);
}

.panel-tag.accent::before {
  content: "● ";
}

.panel-code {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--tile-bg);
  color: var(--text-color);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  white-space: pre;
  overflow: hidden;
}

.panel-code .ln {
  display: inline-block;
  width: 1.4em;
  margin-right: 0.9em;
  text-align: right;
  color: rgba(169, 183, 207, 0.4);
}

.panel-code .code-key { color: var(--code-pink); }
.panel-code .code-fn { color: var(--accent-cyan); }
.panel-code .code-flag { color: var(--code-amber); }

@media (prefers-color-scheme: light) {
  .panel-code .code-fn { color: #3fd0ff; }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding: 2.6rem 0 2rem;
  }
}

/* ---------- Typography ---------- */

h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.home section > h2:not(.hero-title),
.home .terminal-body > h2 {
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.home section > h2:not(.hero-title)::before,
.home .terminal-body > h2::before {
  content: "## ";
  color: var(--accent-cyan);
  opacity: 0.75;
}

h3 {
  font-size: 1rem;
  margin: 1rem 0 0.35rem;
  color: var(--text-color);
  letter-spacing: 0;
}

p {
  line-height: 1.65;
  margin: 0.45rem 0;
  font-size: 1rem;
  color: var(--muted-text);
}

ul,
ol {
  padding-left: 1.3rem;
  margin: 0.45rem 0 0.3rem;
}

li {
  line-height: 1.6;
  margin-bottom: 0.2rem;
  color: var(--muted-text);
}

li strong,
p strong {
  color: var(--text-color);
}

code {
  padding: 0.1em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--panel-border);
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 0.88em;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  word-break: break-word;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  text-decoration: underline;
  text-shadow: 0 0 6px var(--link-glow);
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 0.5rem;
}

.app-store-link img {
  width: 180px;
  height: auto;
  display: block;
  -webkit-user-drag: none;
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 1rem 0 0.5rem;
}

@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  position: relative;
  padding: 1.1rem 1.1rem 1.2rem;
  border-radius: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.card-key {
  margin-bottom: 0.85rem;
  color: var(--accent-cyan);
}

.feature-card h3 {
  margin: 0 0 0.35rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted-text);
}

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

.terminal {
  margin-top: 2.6rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-body {
  padding: 0.4rem 1.4rem 1.3rem;
}

.terminal-body > h2 {
  margin-top: 1rem;
}

.term-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.term-list li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.6rem;
  border-top: 1px dashed var(--panel-border);
  line-height: 1.55;
}

.term-list li:first-child {
  border-top: 0;
}

.term-list li::before {
  content: "›";
  position: absolute;
  left: 0.2rem;
  color: var(--code-green);
  font-weight: 700;
}

/* ---------- Doc blocks ---------- */

.doc-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.2rem;
}

@media (max-width: 760px) {
  .doc-pair {
    grid-template-columns: 1fr;
  }
}

.doc-block {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 10px;
  background: var(--panel-bg);
}

.doc-block > h2 {
  margin-top: 0.4rem;
}

.doc-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--code-green);
}

@media (prefers-color-scheme: light) {
  .doc-label { color: #11795a; }
  .term-list li::before { color: var(--code-green); }
}

.fine-print p {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  opacity: 0.9;
}

.fine-print p::before {
  content: "# ";
  color: var(--accent-cyan);
}

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

footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--panel-border);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted-text);
  opacity: 0.95;
}

footer a {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--kbd-border);
  border-bottom: 3px solid var(--kbd-edge);
  border-radius: 6px;
  background: var(--kbd-bg);
  color: var(--kbd-text);
}

footer a:hover {
  text-decoration: none;
  color: var(--accent-bright);
}

/* ---------- Subpages (privacy / support / terms) ---------- */

.subpage .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 600px) {
  .subpage .container {
    padding: 1rem 1rem 1.6rem;
  }
}

.subpage section,
.subpage .header,
.subpage .container > p,
.subpage .container > ul,
.subpage .container > ol,
.subpage .container > h2,
.subpage footer {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.subpage .header h1 {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.subpage .container > p:first-of-type {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 8px;
  background: var(--panel-bg);
}

.subpage section {
  padding: 1.2rem 0;
  border-top: 1px dashed var(--panel-border);
}

.subpage section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.subpage .container > h2,
.subpage section > h2 {
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.subpage .container > h2 {
  padding-top: 1.35rem;
  border-top: 1px dashed var(--panel-border);
}

.subpage .container > h2::before,
.subpage section > h2::before {
  content: "## ";
  color: var(--accent-cyan);
  opacity: 0.75;
}

.subpage h3 {
  margin-top: 1.4rem;
}

.subpage h3::before {
  content: "› ";
  font-family: var(--mono);
  color: var(--accent-cyan);
}

.subpage li::marker {
  color: var(--accent-cyan);
}

/* ---------- Motion ---------- */

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

@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .container,
  .cursor {
    animation: none;
  }
  .feature-card,
  a {
    transition: none;
  }
  .feature-card:hover {
    transform: none;
  }
}
