/* Sunbend · sunbend.app
   One sun over a horizon, flat warm color, and room to breathe. The page tints itself with the app's color math. */

:root {
  --paper: #f5efe4;      /* unbleached paper */
  --sheet: #faf6ee;
  --ink: #221f1b;
  --ink-2: #67605a;
  --ink-3: #9b928a;
  --line: rgba(34, 31, 27, 0.14);
  --line-soft: rgba(34, 31, 27, 0.08);
  --vermilion: #d8502a;  /* the sun, and the only accent */

  --serif: "Zen Old Mincho", Georgia, serif;
  --sans: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --gutter: 24px;
  --sky-h: 330px;
  --disc: 150px;
  --fade: 0.5s;
  color-scheme: light;
}

@media (max-width: 720px) {
  :root { --sky-h: 240px; --disc: 96px; --gutter: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --fade: 0.05s; }
}
html.is-live { --fade: 0.08s; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--paper); overflow-x: clip; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { top: 16px; }

/* The preview layer. Multiply by the screen gains, as the app does to the display's gamma table. */
.tint {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none;
  mix-blend-mode: multiply;
  background: #fff;
  opacity: 0;
  transition: background var(--fade) linear, opacity 1.4s ease 0.3s;
}
.tint.is-on { opacity: 1; }

/* ---------- Nav ---------- */

.nav-inner { display: flex; align-items: center; gap: 36px; padding-top: 26px; padding-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 21px/1 var(--serif); letter-spacing: 0.01em; }
.mark { width: 26px; height: 26px; }
.mark-sun { fill: var(--vermilion); }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner .btn { margin-left: auto; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent; border-radius: 3px;
  font: 500 15px/1.2 var(--sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; }
.btn-line { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--vermilion); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

/* ---------- Hero ---------- */

.hero { padding-top: 40px; }
.display {
  font: 400 clamp(38px, 5.8vw, 74px)/1.08 var(--serif);
  letter-spacing: -0.012em;
  margin-bottom: 22px;
}
.display .l { display: block; }
.display .sun { font-style: normal; color: var(--vermilion); }
.lede { font-size: 19px; color: var(--ink-2); max-width: 46ch; margin-bottom: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.meta span + span::before { content: "·"; margin: 0 10px; }

/* The sky: the sun's path over the horizon. The horizon line is the slider. */
.stage { position: relative; height: calc(var(--sky-h) + 40px); margin-top: 40px; }
.sky { position: absolute; left: 0; right: 0; top: 0; height: var(--sky-h); overflow: hidden; }
.arc { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); opacity: 0.45; }
.disc {
  position: absolute; left: 0; top: 0;
  width: var(--disc); height: var(--disc); border-radius: 50%;
  background: var(--vermilion);
  box-shadow: 0 0 60px 10px rgba(216, 80, 42, 0.14);
  transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1), background-color var(--fade) linear;
}
html.is-live .disc { transition: background-color var(--fade) linear; }
@media (prefers-reduced-motion: reduce) { .disc { transition: none; } }
.glow {
  position: absolute; bottom: -70px; width: 420px; height: 140px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(216, 80, 42, 0.4), rgba(216, 80, 42, 0));
  opacity: 0;
  transition: opacity var(--fade) linear;
}
.horizon { position: absolute; left: 0; right: 0; top: var(--sky-h); height: 1px; background: var(--ink); opacity: 0.55; }

.mark-v { position: absolute; top: var(--sky-h); width: 0; }
.mark-v::before { content: ""; position: absolute; left: 0; top: -5px; width: 1px; height: 11px; background: var(--ink); opacity: 0.55; }
.mark-v .k {
  position: absolute; left: 0; bottom: 12px; transform: translateX(-50%);
  white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.mark-v .t { position: absolute; left: 0; top: 11px; transform: translateX(-50%); font: 400 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }

.tick { position: absolute; top: calc(var(--sky-h) - 7px); width: 2px; height: 15px; margin-left: -1px; background: var(--vermilion); }

.time-input {
  position: absolute; inset: 0; z-index: 3;
  width: 100%; height: 100%; margin: 0;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: ew-resize;
}
.time-input::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.time-input::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 100%; background: transparent; }
.time-input::-moz-range-track { height: 100%; background: transparent; }
.time-input::-moz-range-thumb { width: 2px; height: 100%; border: 0; border-radius: 0; background: transparent; }
.time-input:focus-visible { outline: 1px solid var(--vermilion); outline-offset: 0; }

.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; margin-top: 22px; }
.clock { display: flex; align-items: baseline; gap: 14px; }
.clock .big { font: 300 36px/1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.state { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); }
.state strong { font-weight: 500; color: var(--ink); }
.state .val { font: 400 14px var(--mono); color: var(--ink-3); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 720px) { .tools { margin-left: 0; } }

.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 3px; }
.seg button { padding: 7px 14px; border: 0; border-radius: 2px; background: none; font: 500 13px/1.2 var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

.note { margin-top: 14px; font-size: 13px; color: var(--ink-3); max-width: 60ch; }

/* ---------- Sections ---------- */

.section { padding-top: 128px; }
@media (max-width: 720px) { .section { padding-top: 88px; } }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--vermilion); margin-bottom: 16px; }
h2 { font: 500 clamp(26px, 3.4vw, 38px)/1.2 var(--sans); letter-spacing: -0.012em; margin-bottom: 14px; max-width: 24ch; }
.lede-s { font-size: 18px; color: var(--ink-2); max-width: 54ch; }

/* The day as six flat swatches: the screen's color in each phase. */
.strip { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.ph { display: grid; gap: 3px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.ph .sw { display: block; height: 150px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 2px; background: #fff; position: relative; transition: background var(--fade) linear; }
.ph[aria-current] .sw::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -7px; height: 2px; background: var(--vermilion); }
.ph .n { font-size: 18px; font-weight: 500; }
.ph .t, .ph .v { font: 400 12px/1.5 var(--mono); color: var(--ink-3); }
.ph .d { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.ph:hover .sw { border-color: var(--ink); }
@media (max-width: 900px) {
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .ph .sw { height: 110px; }
  .ph .d { display: none; }
}

/* Profiles */
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 56px; }
.prof { border-top: 1px solid var(--line); padding-top: 22px; }
.prof h3 { font: 500 22px/1.2 var(--sans); margin-bottom: 8px; }
.prof p { color: var(--ink-2); max-width: 40ch; }
.bar { display: block; width: 100%; height: 22px; margin: 20px 0 10px; border: 1px solid var(--line); border-radius: 2px; }
.prof .vals { font: 400 12px/1.5 var(--mono); color: var(--ink-3); margin-bottom: 18px; }
.prof .btn[aria-checked="true"] { border-color: var(--ink); }
.aside { margin-top: 48px; padding-left: 18px; border-left: 2px solid var(--vermilion); max-width: 60ch; font-size: 15px; color: var(--ink-2); }
@media (max-width: 720px) { .profiles { grid-template-columns: 1fr; gap: 36px; } }

/* Restore */
.restore { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.restore-demo { display: grid; justify-items: start; gap: 18px; padding: 32px; border: 1px solid var(--line); border-radius: 3px; background: var(--sheet); }
.keys { display: inline-flex; gap: 6px; }
.key { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--paper); font: 500 16px var(--mono); }
.hint { font-size: 13px; color: var(--ink-3); }
@media (max-width: 720px) { .restore { grid-template-columns: 1fr; } }

/* Privacy */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 44px; }
.three h3 { font: 500 17px/1.3 var(--sans); padding-top: 16px; border-top: 1px solid var(--line); margin-bottom: 8px; }
.three p { font-size: 15px; color: var(--ink-2); }
@media (max-width: 720px) { .three { grid-template-columns: 1fr; gap: 20px; } }

/* Pricing */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.price-big { font: 400 clamp(36px, 5vw, 60px)/1.12 var(--serif); letter-spacing: -0.012em; }
.price-side { display: grid; justify-items: start; gap: 18px; }
.price-side > p:first-child { color: var(--ink-2); max-width: 36ch; }
@media (max-width: 720px) { .price { grid-template-columns: 1fr; gap: 28px; } }

/* FAQ */
.faq details { max-width: 720px; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 500; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 300 22px/1 var(--mono); color: var(--ink-3); }
details[open] summary::after { content: "−"; }
details p { padding-bottom: 20px; color: var(--ink-2); max-width: 58ch; }

/* Footer */
.foot { margin-top: 128px; border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 32px; padding-bottom: 56px; font-size: 14px; color: var(--ink-3); }
.foot-inner a:not(.brand) { text-decoration: none; }
.foot-inner a:not(.brand):hover { color: var(--ink); }
.foot .brand { font-size: 18px; color: var(--ink); }
.foot-end { margin-left: auto; }

/* Floating readout, above the tint so it stays legible at night. */
.chip {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 3px;
  background: var(--ink); color: var(--paper);
  font: 400 13px/1 var(--mono);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.chip.is-on { opacity: 1; transform: none; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vermilion); }
