/* sites/refractor/styles.css */

:root {
  --accent: #58b0fe;
  --accent-strong: #82c3ff;
  --accent-soft: rgb(88 176 254 / 14%);
  --danger: #eb1e1e;
  --background: #212631;
  --background-elevated: #282e3a;
  --surface: #323a49;
  --surface-strong: #3b4557;
  --border: #4a566d;
  --border-soft: #3b4557;
  --text: #f3f4f7;
  --text-muted: #aab3c5;
  --text-dim: #6d7d9c;
  --code: #181c24;
  --header: rgb(33 38 49 / 86%);
  --shadow: 0 24px 80px rgb(0 0 0 / 36%);
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme='light'] {
  --accent: #256ca7;
  --accent-strong: #114875;
  --accent-soft: rgb(88 176 254 / 10%);
  --background: #f8f9fc;
  --background-elevated: #ffffff;
  --surface: #ffffff;
  --surface-strong: #f1f3f8;
  --border: #d9deea;
  --border-soft: #e8ebf2;
  --text: #212631;
  --text-muted: #4a566d;
  --text-dim: #6d7d9c;
  --code: #212631;
  --header: rgb(248 249 252 / 88%);
  --shadow: 0 24px 72px rgb(28 35 54 / 14%);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--background);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}

.section-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--border-soft);
  background: var(--header);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: white;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 8px 24px rgb(88 176 254 / 28%);
}

.nav {
  display: flex;
  gap: 30px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.nav a:hover {
  color: var(--text);
}

.icon-button {
  justify-self: end;
  width: 38px;
  height: 38px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(40px, 7vw, 96px);
  align-items: center;
  min-height: 680px;
  padding-block: 88px 72px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 28px;
  font-size: clamp(3rem, 6.2vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--text-muted);
}

.hero-lead {
  max-width: 580px;
  margin-bottom: 34px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 14px 34px rgb(88 176 254 / 24%);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copy-label {
  color: var(--text-dim);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
}

.terminal {
  color: var(--accent-strong);
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.proof-row span::before {
  margin-right: 8px;
  color: var(--accent-strong);
  content: '\2713';
}

.code-window,
.code-tabs {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.code-window {
  transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
}

.window-bar,
.tab-list {
  display: flex;
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid #222a39;
  color: #8d98ae;
  background: #111722;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.window-bar {
  padding: 0 16px;
}

.window-dots {
  display: flex;
  gap: 6px;
  margin-right: 20px;
}

.window-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4353;
}

.build-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #9da7b9;
}

.build-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3fdb93;
  box-shadow: 0 0 12px #3fdb93;
}

pre {
  margin: 0;
  color: #bac3d4;
  font:
    0.82rem/1.75 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  tab-size: 2;
  white-space: pre-wrap;
}

.code-window pre {
  min-height: 448px;
  padding: 28px;
}

.syntax-keyword,
.syntax-fn {
  color: #82c3ff;
}

.syntax-string {
  color: #63ce78;
}

.syntax-token {
  color: #f9a95d;
}

.compiled-strip {
  display: grid;
  gap: 7px;
  padding: 16px 20px;
  border-top: 1px solid #222a39;
  background: #0e141e;
}

.compiled-strip span {
  color: #69758c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.compiled-strip code {
  overflow: hidden;
  color: #68d5e1;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--border-soft);
}

.metrics article {
  display: grid;
  gap: 8px;
  padding: 26px 28px;
  border-left: 1px solid var(--border-soft);
}

.metrics article:first-child {
  border-left: 0;
}

.metrics strong {
  font-size: 0.92rem;
}

.metrics span {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.content-section {
  padding-block: 120px;
}

.section-heading {
  max-width: 670px;
  margin-bottom: 58px;
}

.section-heading.compact {
  margin-bottom: 42px;
}

.section-heading h2,
.closing h2 {
  margin-bottom: 22px;
  font-size: clamp(2.1rem, 4.5vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.052em;
}

.section-heading > p:last-child {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 18px;
  align-items: center;
}

.pipeline-card {
  position: relative;
  min-height: 250px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.pipeline-card.featured {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: linear-gradient(145deg, var(--accent-soft), var(--surface) 70%);
}

.step,
.feature-number {
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2rem;
}

.pipeline-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 28px 0 22px;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background-elevated);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pipeline-card h3,
.feature-grid h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.pipeline-card p,
.feature-grid p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.pipeline-arrow {
  color: var(--text-dim);
}

.quick-start {
  padding-top: 36px;
}

.code-tabs {
  max-width: 920px;
}

.tab-list {
  padding-left: 12px;
}

.tab-list button {
  align-self: stretch;
  padding: 0 15px;
  cursor: pointer;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #7e899f;
  background: transparent;
  font-size: 0.75rem;
}

.tab-list button[aria-selected='true'] {
  color: #f4f6fb;
  border-bottom-color: #82c3ff;
}

.tab-list .tab-copy {
  align-self: center;
  min-height: 30px;
  margin-left: auto;
  margin-right: 10px;
  border: 1px solid #2a3344;
  border-radius: 7px;
}

.tab-panel {
  min-height: 390px;
  padding: 30px;
}

.token-section {
  border-block: 1px solid var(--border-soft);
  background: var(--background-elevated);
}

.token-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(50px, 8vw, 110px);
  align-items: center;
}

.token-layout .section-heading {
  margin-bottom: 0;
}

.mapping-list {
  display: grid;
  gap: 1px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}

.mapping-list span {
  display: grid;
  grid-template-columns: 1fr auto 0.65fr;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  background: var(--surface);
}

.mapping-list code {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mapping-list i {
  color: var(--text-dim);
  font-style: normal;
}

.mapping-list b {
  color: var(--accent-strong);
  font-size: 0.78rem;
}

.token-demo {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.editor-line {
  padding: 22px;
  color: #aeb7c8;
  border-bottom: 1px solid #222a39;
  font:
    0.85rem ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

.editor-line b {
  color: #f9a95d;
  font-weight: 400;
}

.suggestions {
  margin: 12px;
  overflow: hidden;
  border: 1px solid #2a3344;
  border-radius: 9px;
  background: #101620;
}

.suggestions p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 11px 14px;
  color: #69758c;
  border-bottom: 1px solid #222a39;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.suggestions button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  width: 100%;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  border: 0;
  color: #dbe1ed;
  background: transparent;
  text-align: left;
}

.suggestions button:hover,
.suggestions button.active {
  background: #1a2130;
}

.suggestions button i {
  width: 13px;
  height: 13px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 3px;
  background: var(--swatch);
}

.suggestions button b {
  font:
    0.78rem ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

.suggestions button span {
  color: #68748a;
  font:
    0.7rem ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

.token-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-top: 1px solid #222a39;
}

.token-preview > span {
  color: #69758c;
  font-size: 0.75rem;
}

.token-preview button {
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #58b0fe;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
}

.feature-grid article {
  min-height: 260px;
  padding: 32px;
  background: var(--surface);
}

.feature-grid h3 {
  margin-top: 44px;
}

.feature-grid p {
  max-width: 470px;
  margin-bottom: 25px;
}

.feature-grid code {
  color: var(--accent-strong);
  font-size: 0.76rem;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.api-grid article {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.api-grid article > div {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.api-grid article > div span {
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.api-grid article > div code {
  font-size: 0.78rem;
}

.api-grid ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-grid li {
  display: grid;
  gap: 7px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.api-grid li:last-child {
  border-bottom: 0;
}

.api-grid li code {
  font-size: 0.76rem;
  font-weight: 700;
}

.api-grid li span {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.closing {
  padding-block: 120px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.closing h2 {
  margin-inline: auto;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: 32px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem;
}

.footer p {
  margin: 0;
}

.footer-logo {
  display: inline-flex;
  width: 96px;
  color: var(--text-muted);
}

.footer-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

.footer-logo-accent {
  fill: var(--accent);
}

.footer > span {
  justify-self: end;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  pointer-events: none;
  opacity: 0;
  color: white;
  border: 1px solid #256ca7;
  border-radius: 9px;
  background: #114875;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero,
  .token-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 72px;
  }

  .code-window {
    transform: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
  }

  .metrics article:nth-child(4) {
    border-top: 1px solid var(--border-soft);
  }

  .pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline-arrow {
    display: none;
  }

  .api-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .footer p {
    display: none;
  }
}

@media (max-width: 640px) {
  .section-shell {
    width: min(100% - 30px, 1180px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-inline: 15px;
  }

  .nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-block: 62px 54px;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .proof-row {
    display: grid;
    gap: 10px;
  }

  .code-window pre {
    min-height: auto;
    padding: 20px;
    font-size: 0.7rem;
  }

  .compiled-strip {
    display: none;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics article,
  .metrics article:nth-child(2),
  .metrics article:nth-child(4) {
    border-top: 1px solid var(--border-soft);
    border-left: 0;
  }

  .metrics article:first-child {
    border-top: 0;
  }

  .content-section,
  .closing {
    padding-block: 84px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .tab-list button {
    padding-inline: 9px;
    font-size: 0.66rem;
  }

  .tab-list .tab-copy {
    display: none;
  }

  .tab-panel {
    min-height: 440px;
    padding: 20px;
    font-size: 0.7rem;
  }

  .token-preview {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .footer {
    padding-block: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


.hero-visual {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #181c24;
  box-shadow: var(--shadow);
}

.hero-visual::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px rgb(255 255 255 / 8%);
  content: '';
}

.hero-visual iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
}

@media (max-width: 900px) {
  .hero-visual,
  .hero-visual iframe {
    min-height: 460px;
    height: 460px;
  }
}

@media (max-width: 640px) {
  .hero-visual,
  .hero-visual iframe {
    min-height: 380px;
    height: 380px;
  }

}
