/* ===== Tokens ===== */
:root {
  --bg: #fbf9f6;
  --bg-inverse: #030303;
  --text-primary: #171717;
  --text-secondary: #373737;
  --text-tertiary: #656565;
  --text-on-brand: #ffffff;
  --border-default: #e7e7e7;
  --border-strong: #d4d4d4;
  --warning-tint: rgba(251, 161, 1, 0.12);
  --warning: #fba101;
  --radius-md: 8px;
  --radius-lg: 20px;
  --radius-pill: 101px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;

  /* Code colors */
  --code-bg: #030303;
  --code-text: #ffffff;
  --code-muted: #b4b4b4;
  --code-keyword: #d6aeff;
  --code-string: #a8e8a8;
  --code-fn: #a7d7ff;
  --code-num: #ffd180;
  --code-comment: #788291;
  --code-line-num: #959595;

  /* Layout */
  --content-max: 1808px;
  --gutter: 64px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ===== Page Layout ===== */
.page {
  position: relative;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* ===== Decorative Ellipses ===== */
/* Anchored to .code-pane so they always sit near the code panel */
.code-pane {
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.ellipse { position: absolute; pointer-events: none; z-index: 0; display: block; }
.ellipse img { width: 100%; height: 100%; }
.ellipse--1 { width: 182px; height: 182px; left: -90px; bottom: -40px; }
.ellipse--2 { width: 102px; height: 102px; right: -50px; bottom: 60px; }
.ellipse--3 { width: 102px; height: 102px; right: -50px; top: -50px; }

/* ===== Header ===== */
.header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px var(--gutter);
  gap: 24px;
}
.logo { display: inline-block; width: 131px; height: 32px; }
.logo img { width: 100%; height: 100%; }
.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

/* ===== Social ===== */
.social { display: flex; align-items: center; gap: var(--space-sm); }
.social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--text-tertiary);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.social__link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}
.social__link:active { transform: scale(0.94); }
.social__link:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
.social__link img { width: 16px; height: 16px; }

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 48px;
  padding: 0 var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1.25;
  white-space: nowrap;
  min-width: 201px;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn__icon {
  width: 18px;
  height: 18px;
  transition: transform var(--dur) var(--ease);
}
.btn:hover .btn__icon { transform: translate(2px, -2px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(251, 161, 1, 0.45);
}

/* primary (dark) */
.btn--primary {
  background: var(--bg-inverse);
  color: var(--text-on-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn--primary:hover {
  background: #1a1a1a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 16px rgba(0, 0, 0, 0.22);
}
.btn--primary:active {
  background: #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 2px 6px rgba(0, 0, 0, 0.28);
}

/* secondary (light) */
.btn--secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(15, 13, 10, 0.04);
}
.btn--secondary:hover {
  background: #f4f1ec;
  border-color: #b8b8b8;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(15, 13, 10, 0.08);
}
.btn--secondary:active {
  background: #ebe7e0;
  box-shadow: 0 1px 2px rgba(15, 13, 10, 0.04);
}

/* ===== Main ===== */
.main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 588px) minmax(0, 1fr);
  align-items: start;
  gap: 88px;
  padding: 96px var(--gutter) 80px;
  flex: 1;
}
.code-pane { z-index: 1; }

/* ===== Hero ===== */
.hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl);
  min-width: 0;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 640px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  align-self: flex-start;
}
.badge__icon { width: 17px; height: 15px; }
.badge span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.92px;
  color: #000;
  line-height: 1.25;
}
.hero__title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #000;
}
.hero__subtitle {
  font-size: 20px;
  letter-spacing: -0.04em;
  line-height: 1.4;
  color: var(--text-tertiary);
}
.hero__actions {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

/* ===== Features ===== */
.features {
  display: flex;
  gap: 24px clamp(16px, 1.6vw, 28px);
  flex-wrap: wrap;
  align-items: center;
}
.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}
.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--warning-tint);
  border-radius: 999px;
  flex-shrink: 0;
}
.feature__icon img { width: 22px; height: 22px; }
.feature__title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}
.feature__sub {
  font-size: 14px;
  letter-spacing: -0.04em;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* ===== Code Card ===== */
.code-card {
  position: relative;
  background: var(--bg-inverse);
  border-radius: var(--radius-lg);
  padding: 24px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow:
    0 24px 30px rgba(15, 13, 10, 0.18),
    0 4px 7px rgba(15, 13, 10, 0.08);
  max-width: 835px;
  width: 100%;
  justify-self: end;
}
.code-card__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
}
.traffic-lights { display: flex; gap: 8px; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.dot--red    { background: #ff5f56; border: 1px solid #e0443e; }
.dot--yellow { background: #ffbd2e; border: 1px solid #dea123; }
.dot--green  { background: #27c93f; border: 1px solid #1aab29; }
.code-card__filename {
  color: #959595;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex: 1;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #c8c8c8;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.copy-btn:active { transform: scale(0.96); }
.copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--code-bg), 0 0 0 4px rgba(251, 161, 1, 0.6);
}
.copy-btn__icon { display: block; }
.copy-btn__icon--check { display: none; }
.copy-btn.is-copied { color: #a8e8a8; background: rgba(168, 232, 168, 0.12); }
.copy-btn.is-copied .copy-btn__icon--copy { display: none; }
.copy-btn.is-copied .copy-btn__icon--check { display: block; }

.code-card__body {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
}
.code {
  margin: 0;
  font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 22px;
  color: var(--code-text);
  counter-reset: line;
}
.code .ln {
  display: block;
  padding-left: 52px;
  position: relative;
  white-space: pre;
  min-height: 22px;
}
.code .ln::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 28px;
  text-align: right;
  color: var(--code-line-num);
  font-weight: 500;
}
.code .k { color: var(--code-keyword); font-weight: 500; }
.code .s { color: var(--code-string); }
.code .f { color: var(--code-fn); }
.code .t { color: var(--code-text); }
.code .p { color: var(--code-muted); }
.code .n { color: var(--code-num); }
.code .c { color: var(--code-comment); }

/* ===== Mascot ===== */
.mascot {
  position: absolute;
  right: -28px;
  bottom: -110px;
  width: 219px;
  height: 275px;
  pointer-events: none;
  z-index: 2;
}
.mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 56px 36px;
  gap: 24px;
  margin-top: auto;
}
.footer__copy {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: -0.03em;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-inverse);
  color: var(--text-on-brand);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  :root { --gutter: 40px; }
  .main {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    padding: 56px var(--gutter) 64px;
  }
  .code-pane { justify-content: stretch; }
  .code-card { justify-self: stretch; max-width: 100%; width: 100%; }
  .ellipse--1 { left: auto; right: 60%; bottom: -50px; }
  .ellipse--2 { right: -30px; bottom: 80px; }
  .ellipse--3 { right: -30px; top: -40px; }
  .mascot { right: 8px; bottom: -80px; width: 180px; height: 226px; }
}

@media (max-width: 768px) {
  :root { --gutter: 20px; }
  .header { padding: 16px var(--gutter); }
  .logo { width: 115px; height: 28px; }
  .header__nav { gap: 12px; }
  .header__nav .btn { display: none; }
  .main {
    padding: 32px var(--gutter) 48px;
    gap: 40px;
  }
  .hero { gap: 36px; }
  .hero__title { font-size: clamp(32px, 8vw, 44px); }
  .hero__subtitle { font-size: 16px; }
  .hero__actions { gap: 12px; }
  .hero__actions .btn { flex: 1 1 100%; min-width: 0; }
  .features {
    gap: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .feature { padding: 4px 0; align-self: stretch; }
  .code-card { padding: 16px 16px 24px; gap: 16px; }
  .code { font-size: 13px; line-height: 20px; }
  .code .ln { padding-left: 40px; min-height: 20px; }
  .code .ln::before { width: 22px; font-size: 12px; }
  .copy-btn__label { display: none; }
  .copy-btn { padding: 6px 8px; }
  .mascot { width: 140px; height: 176px; right: -10px; bottom: -60px; }
  .footer { padding: 20px var(--gutter) 28px; flex-direction: row; }
  .ellipse--1, .ellipse--2, .ellipse--3 { display: none; }
}

@media (max-width: 420px) {
  .hero__title { font-size: 32px; }
  .badge span { font-size: 10px; letter-spacing: 1.6px; }
  .feature__icon { width: 48px; height: 48px; }
  .feature__icon img { width: 20px; height: 20px; }
}
