/* LastByte: the page is the Mac.
   Night blue for the overnight upload, lamp amber for the last byte.
   Rounded display + serif text, both shipped with every Apple device: no font downloads. */

:root {
  --night: #14213b;
  --night-raise: #222c44;
  --on-night: #eef2f9;
  --on-night-mist: #aab6ce;
  --lamp: #ffc24b;
  --lamp-hover: #ffd27a;
  --lamp-ink: #2a1d00;

  --paper: #f4f6fa;
  --surface: #ffffff;
  --ink: #172033;
  --mist: #576276;
  --line: #dce1ea;

  --display: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", "Varela Round", system-ui, sans-serif;
  --text: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --measure: 34em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1424;
    --surface: #141d31;
    --ink: #e8ecf4;
    --mist: #9eaabf;
    --line: #253049;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 48px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 19px;
  line-height: 1.62;
}

a { color: inherit; text-underline-offset: 0.18em; }

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

h1, h2, h3, summary, .display {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Menu bar (site header on every page) ---------- */

.menubar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 26, 48, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  color: var(--on-night);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1;
}

.menubar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 34px;
}

.menubar-menus, .menubar-extras { display: flex; align-items: center; gap: 2px; }

.menubar-menus a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--on-night);
  text-decoration: none;
}

.menubar-menus a:hover { background: rgba(255, 255, 255, 0.14); }
.menubar-menus .brand { font-weight: 700; }
.menubar-menus .brand svg { width: 17px; height: 17px; }

.extra {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
}

.extra svg { width: 17px; height: 17px; }
.extra.is-open { background: rgba(255, 255, 255, 0.2); }

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

.hero {
  background: var(--night);
  color: var(--on-night);
  padding-bottom: 104px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 64px;
}

.hero-copy { padding-top: 88px; }

.hero h1 {
  font-size: clamp(46px, 7.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  max-width: 11ch;
}

.hero .lede {
  font-size: 21px;
  line-height: 1.58;
  color: var(--on-night-mist);
  max-width: 30em;
  margin: 0 0 36px;
}

.buy {
  display: inline-block;
  background: var(--lamp);
  color: var(--lamp-ink);
  font-family: var(--display);
  font-weight: 650;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  border-radius: 12px;
  padding: 17px 26px;
}

.buy:hover { background: var(--lamp-hover); }

.buy-note {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--on-night-mist);
}

/* The dropdown: LastByte's own menu, hanging from the menu bar */

.dropdown {
  align-self: start;
  margin-top: 6px;
  background: var(--night-raise);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(3, 8, 20, 0.55), 0 2px 6px rgba(3, 8, 20, 0.35);
  padding: 14px 16px 16px;
  font-family: var(--ui);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--on-night);
  transform-origin: top right;
  animation: menu-open 240ms ease-out 300ms both;
}

.dd-head { display: flex; justify-content: space-between; align-items: baseline; }
.dd-title { font-weight: 600; }
.dd-state { color: var(--lamp); font-weight: 500; }

.dd-eta {
  display: grid;
  margin: 14px 0 12px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.dd-eta > span { grid-area: 1 / 1; }
.eta-calc { color: var(--on-night-mist); animation: fade-out 200ms ease 1700ms forwards; }
.eta-value { opacity: 0; animation: fade-in 280ms ease 1800ms forwards; }

.dd-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.dd-bar span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: 3px;
  background: var(--lamp);
  animation: bar-fill 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) 1800ms both;
}

.dd-numbers { margin-top: 10px; color: var(--on-night-mist); }
.dd-numbers p { margin: 0; }

.dd-sep { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 14px -16px; }

.dd-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dd-row + .dd-row { margin-top: 12px; }
.dd-row small { display: block; color: var(--on-night-mist); font-size: 12.5px; margin-top: 2px; }

.switch {
  flex: none;
  position: relative;
  width: 32px;
  height: 19px;
  border-radius: 10px;
  background: var(--lamp);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dd-hint { margin: 10px 0 0; color: var(--lamp); font-size: 12.5px; }
.dd-quiet { color: var(--on-night-mist); }

@keyframes menu-open { from { opacity: 0; transform: translateY(-4px) scale(0.985); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes bar-fill { from { width: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dropdown, .eta-value, .dd-bar span { animation: none; }
  .eta-calc { animation: none; visibility: hidden; }
  .eta-value { opacity: 1; }
}

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

.section { padding: 112px 0; }
.section-surface { background: var(--surface); }

.section h2 {
  font-size: clamp(32px, 4.4vw, 46px);
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  max-width: 18ch;
}

.intro {
  max-width: var(--measure);
  color: var(--mist);
  font-size: 20px;
  margin: 0 0 56px;
}

/* A night with LastByte: gaps between entries follow the clock */

.night { list-style: none; margin: 0; padding: 0; max-width: 820px; }

.night li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  column-gap: 32px;
}

.night time {
  grid-column: 1;
  grid-row: 2;
  font-family: var(--display);
  font-weight: 650;
  font-size: 21px;
  line-height: 1.55;
  white-space: nowrap;
}

.night p { grid-column: 2; grid-row: 2; margin: 0; max-width: var(--measure); }
.night strong { font-family: var(--display); font-weight: 650; }

/* The gap before each entry is drawn to scale with the time that passed. */
.night .later {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  margin: 10px 0 10px -18px;
  padding-left: 16px;
  border-left: 2px dotted var(--mist);
  color: var(--mist);
  font-style: italic;
  font-size: 16px;
}

.night .later.short { height: 34px; }
.night .later.long { height: 104px; }
.night .later.longer { height: 150px; }

.state { font-family: var(--display); font-weight: 650; }
.state-stalled { color: #96600f; }
.state-done { color: #17784e; }

@media (prefers-color-scheme: dark) {
  .state-stalled { color: #e7ac52; }
  .state-done { color: #4fc78d; }
}

/* Moments */

.moments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 48px;
  max-width: 980px;
  font-size: 21px;
}

.moments li { position: relative; padding-left: 26px; }

.moments li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--lamp);
}

/* Pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 880px;
}

.plan { padding: 8px 48px 8px 0; }
.plan + .plan { padding: 8px 0 8px 48px; border-left: 1px solid var(--line); }

.plan h3 { font-size: 22px; margin: 0 0 6px; }
.plan .price { font-family: var(--display); font-weight: 650; font-size: 44px; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.plan .price-note { color: var(--mist); font-size: 16px; margin: 4px 0 20px; }
.plan ul { margin: 0 0 28px; padding-left: 1.1em; }
.plan li { margin: 6px 0; }
.plan .refund-note { color: var(--mist); font-size: 15px; margin: 14px 0 0; }

/* Privacy */

.promises {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 0;
}

.promises dt { font-family: var(--display); font-weight: 650; font-size: 21px; margin-bottom: 6px; }
.promises dd { margin: 0; color: var(--mist); }

/* FAQ */

.faq details { max-width: 760px; border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 21px; }
.faq details p { margin: 12px 0 0; color: var(--mist); max-width: var(--measure); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--mist);
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; }
.site-footer a { color: var(--mist); }
.site-footer p { margin: 6px 0; }

/* ---------- Simple pages: notify, legal, 404 ---------- */

.page { max-width: 760px; padding-top: 72px; padding-bottom: 96px; }
.page h1 { font-size: clamp(36px, 5.4vw, 56px); letter-spacing: -0.025em; margin: 0 0 20px; }
.page h2 { font-size: 25px; margin: 44px 0 10px; }
.page .lede { font-size: 21px; color: var(--mist); max-width: var(--measure); }
.page .muted { color: var(--mist); font-size: 16px; }
.page table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.5; margin: 16px 0; }
.page th, .page td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 10px 10px 10px 0; }
.page th { font-family: var(--display); font-weight: 650; color: var(--mist); }

.signup {
  margin: 36px 0;
  padding: 32px;
  border-radius: 16px;
  background: var(--night);
  color: var(--on-night);
}

.signup h2 { margin-top: 0; }
.signup ul { padding-left: 1.1em; margin: 0 0 26px; }
.signup .fine { color: var(--on-night-mist); font-size: 15px; margin: 18px 0 0; }
.signup .fine a { color: var(--on-night); }

/* ---------- Small screens ---------- */

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-copy { padding-top: 56px; }
  .dropdown { margin-top: 0; max-width: 380px; width: 100%; }
  .section { padding: 80px 0; }
  .promises { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 640px) {
  body { font-size: 18px; }
  .wrap { padding: 0 18px; }
  .menubar-menus .optional, .extra.clock { display: none; }
  .hero .lede { font-size: 19px; }
  .night li { grid-template-columns: minmax(0, 1fr); }
  .night time { grid-row: 2; }
  .night p { grid-column: 1; grid-row: 3; }
  .night .later { grid-column: 1; margin-left: 6px; }
  .night .later.long { height: 72px; }
  .night .later.longer { height: 104px; }
  .moments { grid-template-columns: minmax(0, 1fr); font-size: 19px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan, .plan + .plan { padding: 0; border-left: 0; }
  .plan + .plan { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--line); }
  .page table, .page thead, .page tbody, .page tr, .page th, .page td { display: block; }
  .page thead { display: none; }
  .page td { border-bottom: 0; padding: 3px 0; }
  .page tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
}
