/* ============================================================
   mirror9933 — personal project home
   Style: editorial minimal (mitacore-inspired structure)
          PixMart palette + Newsreader / Noto Serif SC display
   ============================================================ */

:root {
  /* palette — light, from pixmart-ai */
  --page: #ffffff;
  --surface: #f6f5f3;
  --ink: #1f1d1b;
  --ink-secondary: #4c4844;
  --muted: #7c766f;
  --line: #e8e5e0;
  --line-strong: #dcd8d2;
  --brand: #c96442;
  --brand-strong: #b5553a;
  --brand-glow: rgba(201, 100, 66, 0.16);
  --glow-opacity: 0.6;

  /* type */
  --font-display: "Newsreader", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.65, 0.25, 1);

  /* section grid: page padding, numbered rail column and gutter.
     The rail hangs in the left margin; the section mirrors the same
     gutter on the right so the reading column stays optically centered. */
  --pad-x: clamp(20px, 4vw, 44px);
  --rail-w: clamp(72px, 8vw, 96px);
  --rail-gap: clamp(20px, 2.6vw, 36px);
}

[data-theme="dark"] {
  --page: #1a1a1a;
  --surface: #222120;
  --ink: #f0efed;
  --ink-secondary: #cfccc8;
  --muted: #9b968f;
  --line: #34322f;
  --line-strong: #454240;
  --brand: #e67e64;
  --brand-strong: #f09279;
  --brand-glow: rgba(230, 126, 100, 0.13);
  --glow-opacity: 0.85;
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 460;
  line-height: 1.7;
  letter-spacing: 0.001em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brand);
  color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid var(--page);
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1, h2, h3, h4, p, dl, dd, dt, ul, ol { margin: 0; padding: 0; }

ul, ol { list-style: none; }

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

.mono {
  font-family: var(--font-mono);
  font-weight: 450;
}

/* faint warm glow, top right */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(880px 480px at 86% -6%, var(--brand-glow), transparent 66%);
  opacity: var(--glow-opacity);
}

/* ---------- floating pill nav ---------- */

.site-nav {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding-inline: 14px;
  pointer-events: none;
}

.pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--page) 76%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}

.wordmark:hover { color: var(--brand); }

.pill-divider {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
}

.pill-links {
  display: flex;
  gap: clamp(12px, 1.8vw, 22px);
}

.pill-links a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.pill-links a:hover { color: var(--ink); }

/* GitHub expanding button — adapted from uiverse.io/vinodjangid07/slimy-impala-17 (MIT):
   octocat circle that widens into a pill and swaps the icon for text on hover */
.gh-btn {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  overflow: hidden;
  cursor: pointer;
  transition: width 0.4s var(--ease), border-radius 0.4s var(--ease);
}

.gh-btn .svgIcon {
  flex: none;
  transition: opacity 0.3s var(--ease);
}

.gh-btn .svgIcon path { fill: var(--page); }

.gh-btn .text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--page);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.gh-btn:hover {
  width: 96px;
  border-radius: 999px;
}

.gh-btn:hover .text { opacity: 1; }

.gh-btn:hover .svgIcon { opacity: 0; }

.gh-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* theme toggle — adapted from uiverse.io/Creatlydev/massive-quail-70 (MIT)
   unchecked = dark (moon) · checked = light (sun), animation is pure CSS */

.toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--page);
  border: 1px solid var(--line);
  box-shadow: 0 0 16px 2px rgba(0, 0, 0, 0.06);
  line-height: 1;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.toggle:hover { border-color: var(--brand); }

.toggle .input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.toggle .icon {
  grid-column: 1 / 1;
  grid-row: 1 / 1;
  display: flex;
  line-height: 0.1;
  color: var(--ink);
  transition: transform 500ms ease;
}

.toggle .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.toggle .icon--moon { transition-delay: 200ms; }

.toggle .icon--sun { transform: scale(0); }

.toggle .input:checked + .icon--moon { transform: rotate(360deg) scale(0); }

.toggle .input:checked ~ .icon--sun {
  transition-delay: 200ms;
  transform: scale(1) rotate(360deg);
}

.toggle:has(.input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* theme radial reveal from click point (View Transitions):
   drop the default cross-fade so the old theme stays put while the new
   one is clip-path expanded over it (circle animated from main.js) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* while the reveal plays, the icon swap is already final in the snapshot */
.theme-vt .toggle .icon { transition: none !important; }

/* ---------- buttons ---------- */

/* buttons — hover stripe sweep adapted from uiverse.io/doniaskima/nervous-wombat-2 (MIT):
   the label blends with mix-blend-mode: difference while two offset stripe
   layers slide in from the top/bottom edges and fill the pill on hover */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
}

.btn-primary > * {
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
  color: #fff;
}

.btn-primary::before,
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--page) 25%, transparent 0,
    transparent 50%, var(--page) 0,
    var(--page) 75%, transparent 0);
  transition: transform 0.2s ease;
}

.btn-primary::before { transform: translateY(101%); }

.btn-primary::after {
  transform: translateY(-101%);
  background: linear-gradient(90deg,
    transparent 0, transparent 25%,
    var(--page) 0, var(--page) 50%,
    transparent 0, transparent 75%,
    var(--page) 0);
}

.btn-primary:hover::before { transform: translateY(0); }

.btn-primary:hover::after { transform: translateY(0); }

.btn-primary:hover { border-color: var(--page); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--page);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}

.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

/* download dialog */
.dl-dialog {
  width: min(420px, calc(100vw - 40px));
  margin: auto;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--page);
  color: var(--ink);
}

.dl-dialog::backdrop {
  background: rgba(22, 20, 18, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dl-dialog[open] { animation: dlgIn 0.28s var(--ease); }

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

.dl-dialog h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 6px 0 22px;
}

.dl-options { display: grid; gap: 10px; }

.dl-option {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.dl-option:hover {
  border-color: var(--brand);
  background: var(--brand-glow);
}

.dl-name { font-size: 15.5px; font-weight: 620; }

.dl-name code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 450;
  padding: 3px 8px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  vertical-align: 2px;
}

.dl-desc { font-size: 13px; color: var(--muted); }

.dl-note {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- hero ---------- */

.hero {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(150px, 19vh, 208px) clamp(20px, 4vw, 44px) clamp(52px, 7vw, 88px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--brand);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: clamp(36px, 6vw, 110px);
  align-items: end;
  margin-top: clamp(30px, 4.5vw, 52px);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 78px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.012em;
}

h1 .line { display: block; }

h1 em,
h2 em {
  font-style: italic;
  color: var(--brand);
  padding-right: 0.06em;
  white-space: nowrap;
}

.hero-intro p {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-secondary);
}

.hero-intro strong {
  font-weight: 620;
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
  margin-top: clamp(60px, 8.5vw, 104px);
}

.stat {
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
}

.stat dt {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat dd {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.8vw, 50px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* ---------- sections (numbered rail layout) ---------- */

.section {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(64px, 9vw, 116px) var(--pad-x);
  /* mirrored right inset: body column centers inside the divider line */
  padding-right: calc(var(--pad-x) + var(--rail-w) + var(--rail-gap));
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: var(--rail-gap);
}

.section-body { min-width: 0; }

.rail {
  display: flex;
  flex-direction: column;  gap: 6px;
  font-size: 12px;
}

.rail-num { color: var(--brand); }

.rail-label {
  color: var(--muted);
  letter-spacing: 0.42em;
}

.section-head {
  margin-bottom: clamp(42px, 6vw, 68px);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(31px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.015em;
  text-wrap: balance;
}

.section-lede {
  margin-top: 18px;
  max-width: 34em;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- products ---------- */

.product {
  padding: clamp(34px, 4.5vw, 52px) 0;
  border-top: 1px solid var(--line);
}

.product-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: start;
}

.meta {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.product h3 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.product-tag {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.product-logo {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px var(--brand-glow);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.product:hover .product-logo {
  transform: translateY(-4px) rotate(-2deg);
  box-shadow: 0 20px 44px var(--brand-glow);
}

.product-logo--type {
  display: grid;
  place-items: center;
  background: var(--surface);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 38px;
  font-weight: 600;
  color: var(--brand);
}

.product-desc {
  margin-top: 24px;
  max-width: 58em;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-secondary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chips li {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-secondary);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.chips li:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

/* ---------- capabilities ---------- */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 5vw, 52px) clamp(24px, 3.4vw, 44px);
}

.cap {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.cap-num {
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 16px;
}

.cap h3 {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.cap p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- process ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
  counter-reset: step;
}

.step {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.step-num {
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 16px;
}

.step h3 {
  font-size: 16.5px;
  font-weight: 620;
  margin-bottom: 10px;
}

.step p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- about ---------- */

.about-statement {
  max-width: 30em;
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 480;
  line-height: 1.72;
  letter-spacing: 0.005em;
}

.about-statement strong { font-weight: 640; }

.about-note {
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
}

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.focus-tags li {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-secondary);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.focus-tags li:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.about-now {
  margin-top: 38px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.about-now::first-line { color: inherit; }

/* ---------- footer ---------- */

.site-footer {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(60px, 8vw, 96px) clamp(20px, 4vw, 44px) 30px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
}

/* :not(.gh-btn) — the GitHub circle manages its own color/transition;
   without the exclusion this rule's higher specificity would clobber
   the button's width transition and make it snap instead of expand */
.footer-links a:not(.gh-btn) {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.footer-links a:not(.gh-btn):hover { color: var(--brand); }

.footer-links .copyright {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .product-logo, .gh-btn { transition: none; }
  .toggle .icon { transition: none; }
  .dl-dialog[open] { animation: none; }
  .btn-primary::before,
  .btn-primary::after { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .section {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-block: clamp(52px, 9vw, 72px);
    padding-right: var(--pad-x);
  }
  .rail { flex-direction: row; align-items: baseline; gap: 14px; }
}

@media (max-width: 860px) {
  .hero { padding-top: 138px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; align-items: start; }
  .product-main { grid-template-columns: 1fr auto; }
}

@media (max-width: 720px) {
  .pill { gap: 12px; padding-left: 16px; }
  .pill-links { display: none; }
  .pill-divider + .pill-links + .pill-divider { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; }
}

@media (max-width: 560px) {
  .cap-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .product-main { grid-template-columns: 1fr; }
  .product-logo { width: 84px; height: 84px; border-radius: 20px; }
}
