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

    :root {
      --night: #09090f;
      --deep: #0f0f1a;
      --mid: #16162a;
      --surface: #1c1c30;
      --rim: rgba(180, 160, 255, 0.12);
      --star: #e8e0ff;
      --moon: #c8b8ff;
      --accent: #7c5cfc;
      --accent2: #b48eff;
      --muted: rgba(200, 184, 255, 0.45);
      --danger: #ff6b6b;
      --good: #6bffb8;
      --warn: #ffcc6b;
      --text: #ede8ff;
      --serif: 'DM Serif Display', Georgia, serif;
      --mono: 'DM Mono', 'Courier New', monospace;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      background: var(--night);
      color: var(--text);
      font-family: var(--mono);
      font-size: 15px;
      line-height: 1.6;
      min-height: 100vh;
      overflow-x: hidden;
    }

    .sky {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      background: radial-gradient(ellipse at 50% 0%, #1a1040 0%, var(--night) 70%);
    }

    .star {
      position: absolute;
      background: white;
      border-radius: 50%;
      animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
    }

    @keyframes twinkle {

      0%,
      100% {
        opacity: var(--min-op, 0.2);
        transform: scale(1);
      }

      50% {
        opacity: var(--max-op, 0.9);
        transform: scale(1.2);
      }
    }

    .moon {
      position: fixed;
      top: 48px;
      right: 80px;
      width: 72px;
      height: 72px;
      z-index: 1;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #f0eaff, #c0a8ff);
      box-shadow: 0 0 40px 12px rgba(180, 140, 255, 0.25), 0 0 80px 30px rgba(120, 80, 220, 0.1);
      animation: moonFloat 8s ease-in-out infinite;
    }

    .moon::after {
      content: '';
      position: absolute;
      top: 8px;
      right: 8px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: rgba(140, 100, 220, 0.3);
    }

    @keyframes moonFloat {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(-8px);
      }
    }

    .page {
      position: relative;
      z-index: 2;
    }

    .hero {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 80px 24px 60px;
      text-align: center;
    }

    .eyebrow {
      font-size: 11px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 24px;
      animation: fadeUp 0.8s ease both;
    }

    h1 {
      font-family: var(--serif);
      font-size: clamp(52px, 9vw, 100px);
      font-weight: 400;
      line-height: 1.05;
      color: var(--star);
      letter-spacing: -1px;
      animation: fadeUp 0.8s 0.1s ease both;
    }

    h1 em {
      font-style: italic;
      color: var(--moon);
    }

    .hero-sub {
      margin-top: 20px;
      max-width: 480px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.8;
      animation: fadeUp 0.8s 0.2s ease both;
    }

    @keyframes fadeUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .calc-card {
      margin: 48px auto 0;
      width: 100%;
      max-width: 520px;
      background: var(--surface);
      border: 0.5px solid var(--rim);
      border-radius: 24px;
      padding: 36px 40px;
      animation: fadeUp 0.8s 0.3s ease both;
    }

    .mode-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 24px;
      background: var(--mid);
      border-radius: 12px;
      padding: 4px;
    }

    .mode-tab {
      flex: 1;
      padding: 9px 8px;
      border-radius: 9px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 12px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .mode-tab.active {
      background: var(--accent);
      color: white;
    }

    .mode-tab:hover:not(.active) {
      color: var(--accent2);
    }

    .sleep-now-btn {
      width: 100%;
      padding: 15px;
      border-radius: 14px;
      border: 0.5px solid var(--accent2);
      background: rgba(124, 92, 252, 0.12);
      font-family: var(--mono);
      font-size: 14px;
      color: var(--accent2);
      cursor: pointer;
      transition: all 0.15s;
      margin-bottom: 16px;
      letter-spacing: 0.03em;
    }

    .sleep-now-btn:hover {
      background: rgba(124, 92, 252, 0.22);
      transform: scale(1.01);
    }

    .sleep-now-btn:active {
      transform: scale(0.99);
    }

    .divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }

    .divider-line {
      flex: 1;
      height: 0.5px;
      background: var(--rim);
    }

    .divider-text {
      font-size: 11px;
      color: var(--muted);
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .field-label {
      font-size: 11px;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 12px;
      display: block;
    }

    .time-picker-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-bottom: 20px;
      width: 100%;
    }

    .time-select {
      background: var(--mid);
      border: 0.5px solid var(--rim);
      border-radius: 12px;
      padding: 14px 12px;
      font-family: var(--mono);
      font-size: 24px;
      font-weight: 500;
      color: var(--star);
      text-align: center;
      outline: none;
      transition: border-color 0.2s;
      -webkit-appearance: none;
      appearance: none;
      cursor: pointer;
    }

    .time-select:focus {
      border-color: var(--accent2);
    }

    .ampm-select {
      font-size: 20px;
    }

    .time-colon {
      font-size: 24px;
      font-weight: 500;
      color: var(--muted);
      padding-bottom: 4px;
    }

    .calc-btn {
      width: 100%;
      padding: 16px;
      border-radius: 14px;
      background: var(--accent);
      border: none;
      font-family: var(--mono);
      font-size: 15px;
      font-weight: 500;
      color: white;
      cursor: pointer;
      transition: transform 0.15s, background 0.15s;
      letter-spacing: 0.05em;
    }

    .calc-btn:hover {
      background: var(--accent2);
      transform: scale(1.01);
    }

    .calc-btn:active {
      transform: scale(0.99);
    }

    .results {
      display: none;
      margin-top: 32px;
    }

    .results.visible {
      display: block;
      animation: fadeUp 0.5s ease both;
    }

    .results-label {
      font-size: 11px;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 16px;
      text-align: center;
    }

    .time-options {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .time-opt {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px;
      border-radius: 14px;
      border: 0.5px solid var(--rim);
      background: var(--mid);
      transition: all 0.2s;
    }

    .time-opt:hover {
      border-color: var(--accent2);
      background: rgba(124, 92, 252, 0.08);
    }

    .time-opt.best {
      border-color: var(--good);
      background: rgba(107, 255, 184, 0.06);
    }

    .time-opt.ok {
      border-color: var(--warn);
      background: rgba(255, 204, 107, 0.05);
    }

    .time-opt.late {
      border-color: var(--danger);
      background: rgba(255, 107, 107, 0.05);
    }

    .opt-time {
      font-size: 22px;
      font-weight: 500;
      color: var(--star);
    }

    .opt-right {
      text-align: right;
    }

    .opt-cycles {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .opt-badge {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 99px;
      font-weight: 500;
      letter-spacing: 0.05em;
    }

    .best .opt-badge {
      background: rgba(107, 255, 184, 0.15);
      color: var(--good);
    }

    .ok .opt-badge {
      background: rgba(255, 204, 107, 0.15);
      color: var(--warn);
    }

    .late .opt-badge {
      background: rgba(255, 107, 107, 0.15);
      color: var(--danger);
    }

    .opt-badge:empty {
      display: none;
    }

    .share-row {
      display: flex;
      gap: 8px;
      margin-top: 16px;
    }

    .share-btn {
      flex: 1;
      padding: 11px 12px;
      border-radius: 10px;
      border: 0.5px solid var(--rim);
      background: var(--mid);
      font-family: var(--mono);
      font-size: 12px;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.15s;
      text-align: center;
    }

    .share-btn:hover {
      border-color: var(--accent2);
      color: var(--accent2);
    }

    .share-btn.copied {
      border-color: var(--good);
      color: var(--good);
    }

    .fallasleep-note {
      margin-top: 12px;
      padding: 12px 16px;
      background: rgba(124, 92, 252, 0.08);
      border-radius: 10px;
      font-size: 12px;
      color: var(--muted);
      text-align: center;
      line-height: 1.6;
      border: 0.5px solid rgba(124, 92, 252, 0.2);
    }

    .nap-section {
      max-width: 520px;
      margin: 0 auto;
      padding: 0 24px;
    }

    .nap-card {
      background: var(--surface);
      border: 0.5px solid var(--rim);
      border-radius: 24px;
      padding: 32px 36px;
      margin-top: 20px;
    }

    .nap-card h3 {
      font-family: var(--serif);
      font-size: 26px;
      font-weight: 400;
      color: var(--star);
      margin-bottom: 8px;
    }

    .nap-card p {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 20px;
      line-height: 1.7;
    }

    .nap-options {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
    }

    .nap-opt {
      padding: 16px 10px;
      border-radius: 14px;
      border: 0.5px solid var(--rim);
      background: var(--mid);
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
    }

    .nap-opt:hover {
      transform: translateY(-2px);
    }

    .nap-opt.danger-nap {
      border-color: rgba(255, 107, 107, 0.4);
    }

    .nap-opt.good-nap {
      border-color: rgba(107, 255, 184, 0.3);
    }

    .nap-duration {
      font-size: 18px;
      font-weight: 500;
      color: var(--star);
      margin-bottom: 4px;
    }

    .nap-name {
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 8px;
    }

    .nap-verdict {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 99px;
      font-weight: 500;
    }

    .good-nap .nap-verdict {
      background: rgba(107, 255, 184, 0.15);
      color: var(--good);
    }

    .danger-nap .nap-verdict {
      background: rgba(255, 107, 107, 0.15);
      color: var(--danger);
    }

    .nap-result {
      margin-top: 16px;
      padding: 14px 16px;
      background: rgba(124, 92, 252, 0.08);
      border-radius: 12px;
      border: 0.5px solid rgba(124, 92, 252, 0.2);
      font-size: 13px;
      color: var(--muted);
      display: none;
      line-height: 1.8;
    }

    .nap-result.visible {
      display: block;
      animation: fadeUp 0.3s ease both;
    }

    .nap-result strong {
      color: var(--accent2);
    }

    .science {
      max-width: 680px;
      margin: 100px auto;
      padding: 0 24px;
    }

    .section-eyebrow {
      font-size: 11px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 16px;
    }

    .science h2 {
      font-family: var(--serif);
      font-size: clamp(32px, 5vw, 52px);
      font-weight: 400;
      line-height: 1.15;
      margin-bottom: 24px;
      color: var(--star);
    }

    .science p {
      color: var(--muted);
      line-height: 1.9;
      margin-bottom: 16px;
      font-size: 14px;
    }

    .cycle-visual {
      margin: 40px 0;
      display: flex;
      align-items: flex-end;
      gap: 6px;
      height: 80px;
    }

    .cycle-bar {
      flex: 1;
      border-radius: 6px 6px 0 0;
      background: var(--accent);
      opacity: 0.15;
      transition: opacity 0.3s;
      cursor: default;
    }

    .cycle-bar:hover {
      opacity: 0.6;
    }

    .cycle-bar.full {
      opacity: 0.7;
    }

    .cards-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 40px;
    }

    .fact-card {
      background: var(--surface);
      border: 0.5px solid var(--rim);
      border-radius: 16px;
      padding: 20px;
    }

    .fact-num {
      font-family: var(--serif);
      font-size: 36px;
      color: var(--moon);
      margin-bottom: 6px;
    }

    .fact-label {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

    .faq {
      max-width: 600px;
      margin: 80px auto;
      padding: 0 24px 80px;
    }

    .faq h2 {
      font-family: var(--serif);
      font-size: 36px;
      margin-bottom: 32px;
      color: var(--star);
    }

    .faq-item {
      border-top: 0.5px solid var(--rim);
      padding: 20px 0;
    }

    .faq-item:last-child {
      border-bottom: 0.5px solid var(--rim);
    }

    .faq-q {
      font-size: 14px;
      color: var(--accent2);
      margin-bottom: 8px;
    }

    .faq-a {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.8;
    }

    .footer {
      text-align: center;
      padding: 40px 24px;
      font-size: 12px;
      color: rgba(200, 184, 255, 0.25);
      border-top: 0.5px solid var(--rim);
    }

    @media (max-width: 560px) {

      .calc-card,
      .nap-card {
        padding: 24px 20px;
      }

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

      .moon {
        width: 48px;
        height: 48px;
        top: 24px;
        right: 24px;
      }

      .nap-options {
        grid-template-columns: 1fr;
      }
    }
