/* mathd.com/sundial — solar instrument */

:root {
  --void: #0a0908;
  --panel: #131110;
  --panel-2: #1c1917;
  --line: #2b2724;
  --line-hot: #453d35;
  --text: #f0ebe3;
  --text-2: #a29a8e;
  --text-3: #6b645b;
  --sun-1: #ffcc4d;
  --sun-2: #ff9a3c;
  --sun-3: #f4623a;
  --sun-4: #b8402f;
  --cool: #4ea3b8;
  --shell: min(1240px, 100% - 3rem);
  --r: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: 'Sora', ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1rem, .95rem + .22vw, 1.08rem);
  line-height: 1.65;
  overflow-x: hidden;
}

/* radial atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(46rem 46rem at 78% -8%, rgba(255, 154, 60, .16), transparent 62%),
    radial-gradient(36rem 36rem at 6% 42%, rgba(78, 163, 184, .08), transparent 60%);
  pointer-events: none;
}
/* faint concentric rings, echoing the sunburst */
body::after {
  content: '';
  position: fixed;
  top: -30vmax; right: -34vmax;
  width: 100vmax; height: 100vmax;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  opacity: .3;
  background: repeating-radial-gradient(circle, transparent 0 38px, rgba(255, 204, 77, .055) 38px 39px);
  mask-image: radial-gradient(circle, #000 30%, transparent 72%);
}

a { color: inherit; }

.shell { width: var(--shell); margin-inline: auto; }

.mono {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: .73rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---------- nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--void) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding-block: .95rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .62rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.015em;
  font-size: 1.02rem;
}
.brand .glyph {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: conic-gradient(var(--sun-1), var(--sun-3), var(--sun-4), var(--sun-2), var(--sun-1));
  box-shadow: 0 0 14px rgba(255, 154, 60, .5);
}
.topbar nav { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }
.topbar nav a {
  text-decoration: none;
  color: var(--text-2);
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: color .2s;
}
.topbar nav a:hover { color: var(--sun-1); }
.topbar nav a.up { color: var(--text-3); }
@media (max-width: 680px) { .topbar nav a.hide-sm { display: none; } }

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

.hero {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
}
@media (min-width: 940px) {
  .hero { grid-template-columns: 1.05fr .95fr; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line-hot);
  border-radius: 999px;
  padding: .34rem .9rem;
  color: var(--sun-1);
  background: rgba(255, 204, 77, .06);
}
.tag .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun-1);
  box-shadow: 0 0 0 0 rgba(255, 204, 77, .55);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 204, 77, .5); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 204, 77, 0); }
}

.hero h1 {
  font-size: clamp(2.7rem, 1.5rem + 5.4vw, 5.3rem);
  font-weight: 700;
  line-height: .94;
  letter-spacing: -.035em;
  margin: 1.7rem 0 0;
  text-wrap: balance;
  color: var(--text);
}
.hero h1 em { color: var(--sun-1); font-style: normal; }

.hero .lede {
  margin: 1.5rem 0 0;
  max-width: 44ch;
  font-size: clamp(1.06rem, 1rem + .4vw, 1.22rem);
  color: var(--text-2);
  text-wrap: pretty;
}

.cta-row { margin-top: 2.4rem; display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border-radius: var(--r);
  padding: .78rem 1.3rem;
  text-decoration: none;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line-hot);
  color: var(--text);
  transition: transform .18s, border-color .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--sun-2); color: var(--sun-1); }
.btn-solid {
  background: linear-gradient(140deg, var(--sun-1), var(--sun-3));
  color: #1a0f05;
  border-color: transparent;
  font-weight: 700;
}
.btn-solid:hover { color: #1a0f05; box-shadow: 0 10px 30px -10px rgba(255, 154, 60, .6); }

.note { margin: 1.1rem 0 0; color: var(--text-3); font-family: 'Space Mono', ui-monospace, monospace; font-size: .72rem; letter-spacing: .06em; }
.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .7rem;
  margin-top: 1.35rem;
  color: var(--text-2);
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: .68rem;
  letter-spacing: .03em;
}
.hero-details span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.hero-details span:not(:last-child)::after {
  content: '·';
  color: var(--sun-2);
}

/* ---------- sunburst ---------- */

.burst-wrap { position: relative; display: grid; place-items: center; margin: 0; }
.hero-shot {
  display: block;
  width: min(100%, 560px);
  height: auto;
  border: 1px solid var(--line-hot);
  border-radius: 16px;
  box-shadow: 0 28px 80px -34px rgba(255, 154, 60, .42);
  background: #000;
}
.hero-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, 560px);
  padding-top: .7rem;
  color: var(--text-2);
  font-size: .78rem;
}
.hero-caption span { color: var(--text); font-weight: 600; }
.hero-caption small { color: var(--text-3); }

/* ---------- signal band ---------- */

.signal-band {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line-hot);
  background: var(--line-hot);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: clamp(1rem, 4vw, 3rem);
}
.signal-band > * { min-width: 0; background: var(--panel); padding: 1.2rem 1.35rem; }
.signal-intro { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 600; }
.signal-mark { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--sun-1); box-shadow: 0 0 18px rgba(255, 204, 77, .6); }
.signal-stat { display: grid; gap: .22rem; }
.signal-stat strong { color: var(--sun-1); font-size: .85rem; font-weight: 600; }
.signal-stat span { color: var(--text-3); font-size: .78rem; line-height: 1.4; }
@media (max-width: 860px) {
  .signal-band { grid-template-columns: 1fr 1fr; }
  .signal-intro { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .signal-band { grid-template-columns: 1fr; }
  .signal-intro { grid-column: auto; }
}

/* ---------- sections ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); }

.sec-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 .8rem;
  color: var(--text);
  font-family: 'Sora', ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-transform: none;
  text-wrap: balance;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.sec-lede { max-width: 58ch; margin: 0 0 3rem; color: var(--text-2); font-size: 1.1rem; text-wrap: pretty; }

/* ---------- view cards ---------- */

.views { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); }

.view {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.view:hover { border-color: var(--line-hot); transform: translateY(-3px); }
.view::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--sun-1), var(--sun-3), transparent);
  opacity: .55;
}
.view:nth-child(2) .ico { color: var(--cool); }
.view:nth-child(3) .ico { color: #c47bd8; }
.view .ico { display: block; margin-bottom: 1.1rem; color: var(--sun-2); }
.view h3 { margin: 0 0 .55rem; font-size: 1.16rem; font-weight: 600; letter-spacing: -.02em; }
.view p { margin: 0; color: var(--text-2); font-size: .95rem; }

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.screenshot-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}
.screenshot-card figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem 1rem;
}
.screenshot-card figcaption span { font-weight: 600; }
.screenshot-card figcaption small { color: var(--text-2); text-align: right; }

@media (max-width: 720px) {
  .screenshot-grid { grid-template-columns: 1fr; }
  .hero-caption { align-items: flex-start; flex-direction: column; gap: .15rem; }
}

/* ---------- feature list ---------- */

.facts { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
@media (min-width: 800px) { .facts { grid-template-columns: 1fr 1fr; } }

.fact { padding: 1.7rem; border-bottom: 1px solid var(--line); background: var(--panel); }
@media (min-width: 800px) {
  .fact:nth-child(odd) { border-right: 1px solid var(--line); }
  .fact:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 799px) { .fact:last-child { border-bottom: 0; } }

.fact h3 { margin: 0 0 .6rem; font-size: 1.06rem; font-weight: 600; letter-spacing: -.015em; display: flex; align-items: center; gap: .6rem; }
.fact h3::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--sun-2); flex: none; }
.fact p { margin: 0; color: var(--text-2); font-size: .95rem; }

/* ---------- keyboard table ---------- */

.keys { width: 100%; border-collapse: collapse; font-size: .93rem; }
.keys caption { text-align: left; color: var(--text-3); padding-bottom: 1rem; font-family: 'Space Mono', ui-monospace, monospace; font-size: .73rem; letter-spacing: .14em; text-transform: uppercase; }
.keys td { padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys tr:last-child td { border-bottom: 0; }
.keys td:first-child { width: 1%; white-space: nowrap; }
.keys td:last-child { color: var(--text-2); }
kbd {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: .76rem;
  border: 1px solid var(--line-hot);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .16rem .45rem;
  background: var(--panel-2);
  color: var(--sun-1);
  white-space: nowrap;
}

/* ---------- code ---------- */

.code {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.code-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-hot); }
.code-bar span { margin-left: .5rem; color: var(--text-3); font-family: 'Space Mono', ui-monospace, monospace; font-size: .71rem; letter-spacing: .1em; }
.code pre { margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto; font-family: 'Space Mono', ui-monospace, monospace; font-size: .83rem; line-height: 1.85; color: var(--text-2); }
.code .c { color: var(--text-3); }
.code .k { color: var(--sun-1); }

.split { display: grid; gap: 2.6rem; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- honest / limits ---------- */

.limits { border: 1px solid var(--line); border-radius: 10px; padding: 1.8rem 2rem; background: var(--panel); }
.limits ul { margin: 0; padding-left: 1.15rem; color: var(--text-2); }
.limits li { margin-bottom: .7rem; }
.limits li:last-child { margin-bottom: 0; }
.limits li::marker { color: var(--cool); }

/* ---------- finish ---------- */

.section[id="views"] { padding-top: clamp(2rem, 5vw, 4rem); }
.screenshot-card { transition: transform .25s ease-out, border-color .25s ease-out; }
.screenshot-card:hover { transform: translateY(-4px); border-color: var(--line-hot); }
.screenshot-card img { background: #050505; }
.section:last-of-type { padding-bottom: clamp(4.5rem, 10vw, 8rem); }

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

.foot { border-top: 1px solid var(--line); padding-block: 2.6rem 3.6rem; display: flex; gap: 1.2rem 2.2rem; flex-wrap: wrap; align-items: center; color: var(--text-3); }
.foot nav { margin-left: auto; display: flex; gap: 1.6rem; flex-wrap: wrap; }
.foot a { text-decoration: none; color: var(--text-2); transition: color .2s; }
.foot a:hover { color: var(--sun-1); }

/* ---------- shared reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .85s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.d1 { animation-delay: .05s } .d2 { animation-delay: .15s } .d3 { animation-delay: .26s } .d4 { animation-delay: .37s } .d5 { animation-delay: .48s }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* code bar dots read as traffic lights, not light chrome */
.code-bar i:nth-child(1) { background: #d4563f; }
.code-bar i:nth-child(2) { background: #d9a03c; }
.code-bar i:nth-child(3) { background: #57a05a; }
.code code { color: var(--sun-1); font-family: 'Space Mono', ui-monospace, monospace; font-size: .88em; }
.fact code { color: var(--sun-1); font-family: 'Space Mono', ui-monospace, monospace; font-size: .87em; background: rgba(255,204,77,.07); padding: .08em .35em; border-radius: 3px; }

/* visible focus everywhere */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--sun-2);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- policy / support pages ---------- */

.doc { max-width: 68ch; padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3.5rem, 8vw, 6rem); }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .6rem; }
.doc h2 { font-size: 1.15rem; margin: 2.6rem 0 .9rem; color: var(--sun-1); }
.doc p, .doc li { color: var(--text-2); text-wrap: pretty; }
.doc ul { padding-left: 1.15rem; }
.doc li { margin-bottom: .5rem; }
.doc li::marker { color: var(--sun-3); }
.doc code { color: var(--sun-1); font-family: 'Space Mono', ui-monospace, monospace; font-size: .87em; overflow-wrap: anywhere; }
.doc .stamp { color: var(--text-3); font-size: .9rem; margin: 0 0 2rem; }
.doc h3 { font-size: 1rem; margin: 1.8rem 0 .5rem; color: var(--text); }
