:root {
  --bg: #faf8f4;
  --surface: #f2efe8;
  --text: #1d1b18;
  --muted: #6b665e;
  --rule: #e2ddd3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1d1c19;
    --text: #ece8e1;
    --muted: #9a948a;
    --rule: #2c2a26;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.7;
  padding: 0 24px;
}
a { color: var(--text); text-underline-offset: 3px; }
.wrap { max-width: 720px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap > main { flex: 1; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  padding: 32px 0;
}
.site-header .name { font-weight: 600; letter-spacing: 0.02em; font-size: 15px; text-decoration: none; }
.site-header nav { display: flex; gap: 20px; font-size: 15px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

/* Type */
h1, .display {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(30px, 5vw, 40px); margin: 24px 0 8px; }
h2 { font-size: 17px; font-weight: 600; margin: 32px 0 8px; }
p, ul { margin-bottom: 12px; }
ul { padding-left: 20px; }
.date { color: var(--muted); font-size: 14px; margin-bottom: 40px; }
.lead { font-size: 18px; color: var(--muted); }

/* Home */
.home { display: flex; align-items: center; justify-content: center; }
.hero { padding: 48px 0; text-align: center; }
.hero .display { font-size: clamp(34px, 6vw, 52px); max-width: 640px; margin: 0 auto 32px; }
.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--muted); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
.button.secondary:hover, .button.secondary:focus-visible { background: var(--text); color: var(--bg); box-shadow: inset 0 0 0 1px var(--text); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .button.secondary { transition: none; } .button.secondary:hover { transform: none; } }

/* Product */
.product { padding: 48px 0; text-align: center; width: 100%; max-width: 680px; min-width: 0; }
.product .lead { max-width: 520px; margin-left: auto; margin-right: auto; }
.app-icon { width: 120px; height: 120px; border-radius: 27px; display: block; margin: 0 auto 24px; }
.product .display { font-size: clamp(40px, 7vw, 56px); margin: 0 0 4px; }
.product .tagline { font-size: 20px; margin-bottom: 16px; }
.product .lead { margin-bottom: 28px; }
.product .try { margin-top: 24px; font-size: 15px; color: var(--muted); }
.product .try a { color: var(--muted); }
.store-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 18px 8px;
  border-radius: 10px;
  background: #000;
  color: #fff;
  border: 1px solid #a6a6a6;
  line-height: 1.1;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.store-badge .small { font-size: 11px; letter-spacing: 0.01em; }
.store-badge .big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }

.carousel { position: relative; margin-top: 48px; }
.screens {
  display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 0 12px; scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screens > * { min-width: 0; flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; aspect-ratio: 390 / 844; border-radius: 24px; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--bg); color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer; z-index: 1;
}
.carousel-btn.prev { left: -56px; }
.carousel-btn.next { right: -56px; }
.screens img { width: 100%; height: auto; border: 1px solid var(--rule); object-fit: cover; }
.shot-placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--muted); color: var(--muted); font-size: 13px;
  position: relative; overflow: hidden;
}
.shot-placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
@media (max-width: 800px) {
  .screens > * { flex-basis: 62%; }
  .carousel-btn { display: none; }
}

/* Home background: soft glow in the Metis icon colors */
.glow {
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(32% 40% at 36% 42%, rgba(214, 96, 104, 0.38), transparent 70%),
    radial-gradient(36% 44% at 60% 40%, rgba(96, 170, 224, 0.34), transparent 70%),
    radial-gradient(34% 42% at 62% 62%, rgba(90, 222, 190, 0.34), transparent 70%),
    radial-gradient(30% 38% at 42% 64%, rgba(150, 140, 214, 0.32), transparent 70%);
  filter: blur(48px);
  animation: drift 24s ease-in-out infinite alternate;
}
@media (prefers-color-scheme: light) {
  .glow { opacity: 0.55; }
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 24px;
}
.footer-main { display: flex; flex-direction: column; gap: 6px; }
.site-footer .rights { margin-left: auto; text-align: right; }
@media (max-width: 800px) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .site-footer .rights { margin-left: 0; text-align: left; }
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .company { color: var(--text); font-weight: 600; }

.divider { border: 0; border-top: 1px solid var(--rule); margin: 40px 0 32px; }

/* 404 */
.notfound { text-align: center; padding: 32px 0; width: 100%; max-width: 600px; min-width: 0; }
.code-404 {
  position: relative; display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: -0.06em;
  font-size: clamp(88px, 18vw, 150px); line-height: 1; margin-bottom: 20px;
  animation: flicker 2.4s infinite steps(1);
  color: var(--text);
}
.code-404::before, .code-404::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.code-404::before { color: #ff3b3b; animation: glitch-a 2.4s infinite steps(1); }
.code-404::after  { color: #00d1ff; animation: glitch-b 2.4s infinite steps(1); }
@keyframes glitch-a {
  0%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  6%  { opacity: .85; transform: translate(-5px, 1px); clip-path: inset(12% 0 58% 0); }
  9%  { opacity: 0; }
  31% { opacity: .85; transform: translate(4px, -1px); clip-path: inset(62% 0 8% 0); }
  33% { opacity: 0; }
  52% { opacity: .85; transform: translate(-3px, 0); clip-path: inset(35% 0 40% 0); }
  55% { opacity: .85; transform: translate(6px, 2px); clip-path: inset(5% 0 80% 0); }
  58% { opacity: 0; }
  78% { opacity: .85; transform: translate(-2px, -2px); clip-path: inset(70% 0 12% 0); }
  80% { opacity: 0; }
  91% { opacity: .85; transform: translate(3px, 1px); clip-path: inset(25% 0 50% 0); }
  93% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  7%  { opacity: .85; transform: translate(5px, -1px); clip-path: inset(50% 0 22% 0); }
  10% { opacity: 0; }
  30% { opacity: .85; transform: translate(-4px, 2px); clip-path: inset(4% 0 70% 0); }
  32% { opacity: 0; }
  53% { opacity: .85; transform: translate(3px, 0); clip-path: inset(75% 0 4% 0); }
  56% { opacity: .85; transform: translate(-6px, -1px); clip-path: inset(40% 0 35% 0); }
  59% { opacity: 0; }
  79% { opacity: .85; transform: translate(2px, 2px); clip-path: inset(15% 0 65% 0); }
  81% { opacity: 0; }
  92% { opacity: .85; transform: translate(-3px, -1px); clip-path: inset(55% 0 25% 0); }
  94% { opacity: 0; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  5% { opacity: .55; } 6% { opacity: 1; }
  30% { opacity: .8; } 31% { opacity: 1; }
  52% { opacity: .35; } 53% { opacity: 1; } 55% { opacity: .7; } 56% { opacity: 1; }
  77% { opacity: .6; } 78% { opacity: 1; }
  90% { opacity: .85; } 91% { opacity: 1; }
}
.notfound h1 { margin: 0 0 8px; font-size: clamp(26px, 4.5vw, 34px); }
.notfound .lead { margin-bottom: 32px; }
.term {
  text-align: left; border-radius: 12px; overflow: hidden;
  background: #0f0e0d; color: #e8e4dc;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.2);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #1b1a18; border-bottom: 1px solid rgba(255,255,255,.06); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3835; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { flex: 1; text-align: center; font-size: 12px; color: #8a857c; margin-right: 46px; }
.term-body { padding: 18px 20px 20px; font: 13.5px/1.9 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: nowrap; }
.term .ps { color: #3fb950; margin-right: 4px; }
.term .path { color: #e3b341; }
.term .err { color: #ff6b73; font-weight: 600; }
.term .dim { color: #8a857c; }
.term .ls { display: flex; flex-wrap: wrap; gap: 4px 18px; white-space: normal; }
.term a { color: #e8e4dc; text-decoration: underline; text-decoration-color: #5a5650; text-underline-offset: 3px; }
.term a:hover { text-decoration-color: #e8e4dc; }
.term .cmd { color: #e8e4dc; }
.cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -3px; margin-left: 2px; background: #e8e4dc; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .code-404, .code-404::before, .code-404::after, .cursor { animation: none; }
}
