:root {
  --bg: #ffffff;
  --ink: #111111;
  --mute: #6a6a6a;
  --line: #ececec;
  --soft: #f7f7f7;
  --accent: #ff4d1a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand span {
  color: var(--accent);
}

.meta {
  color: var(--mute);
  font-size: 13px;
}

main {
  width: min(980px, calc(100% - 40px));
  margin: 56px auto 80px;
}

h1 {
  margin: 0 0 10px;
  font-size: 40px;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.lead {
  margin: 0 0 32px;
  color: var(--mute);
  max-width: 38em;
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 13px;
  color: var(--mute);
}

input[type="url"],
.drop {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 14px 14px;
  font: inherit;
  color: inherit;
}

input[type="url"]:focus,
.drop:focus-within {
  outline: 2px solid #111;
  outline-offset: 1px;
}

.drop {
  min-height: 92px;
  display: grid;
  place-items: center;
  color: var(--mute);
  cursor: pointer;
}

.drop strong {
  color: var(--ink);
  font-weight: 600;
}

.switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}

.switch-knob {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  background: #111;
  border-radius: 9px;
  transition: transform 0.22s ease;
}

.switch[data-pos="0"] .switch-knob {
  transform: translateX(0);
}

.switch[data-pos="1"] .switch-knob {
  transform: translateX(100%);
}

.switch[data-pos="2"] .switch-knob {
  transform: translateX(200%);
}

.switch button {
  position: relative;
  z-index: 1;
  background: transparent;
  color: var(--ink);
  padding: 10px 8px;
  font-weight: 600;
}

.switch button.on {
  color: #fff;
}

.mode-hint {
  margin: 8px 0 0;
  color: var(--mute);
  font-size: 13px;
}

.shot {
  display: inline-block;
  vertical-align: top;
  margin: 12px 10px 4px 0;
  width: calc(33.333% - 10px);
  max-width: none;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.shot figcaption {
  margin-top: 6px;
  color: var(--mute);
  font-size: 12px;
  line-height: 1.35;
}

.shot-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  margin: 14px 0;
}

.shot-row .shot {
  display: block;
  flex: 1 1 calc(33.333% - 8px);
  min-width: 0;
  width: auto;
  margin: 0;
  max-width: calc(33.333% - 8px);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.downloads {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 28px;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.price {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 13px;
}

button {
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.or {
  color: var(--mute);
  font-size: 13px;
  text-align: center;
}

.status {
  margin-top: 28px;
  padding: 16px 0;
  color: var(--mute);
}

.status-label {
  margin-bottom: 10px;
}

.status .bar {
  height: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.status .bar-fill {
  height: 100%;
  width: 0;
  background: #111;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.status.error .bar {
  display: none;
}

.error {
  color: #b42318;
}

article h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.sheet {
  margin: 32px 0 20px;
  padding: 28px 28px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.05);
}

.sheet .notebook {
  margin: 8px 0 8px;
}

.sheet section.after:first-of-type {
  border-top: 1px solid var(--line);
}

.one {
  color: var(--mute);
  margin: 0 0 20px;
}

.lede {
  margin: 0 0 32px;
  padding: 14px 16px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.lede h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mute);
}

.lede p {
  margin: 0;
}

.notebook {
  position: relative;
  margin: 8px 0 36px;
}

.passage {
  margin: 0 0 22px;
}

.passage h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.passage p {
  margin: 0 0 8px;
}

.passage ul {
  margin: 0 0 8px;
}

.notebook hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.beat {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 22px;
}

.notebook.hours .beat {
  grid-template-columns: 72px 1fr;
}

.rail {
  position: relative;
  padding-top: var(--gap, 0px);
}

.rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 5px;
  width: 1px;
  background: #ececec;
}

.beat:first-child .rail::before {
  top: 10px;
}

.beat:last-child .rail::before {
  bottom: auto;
  height: 14px;
}

.tick {
  position: relative;
  display: block;
  min-height: 18px;
  padding-right: 16px;
  text-align: right;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: -0.03em;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.tick.on::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 0 3px #fff;
}

.note {
  padding: 0 0 22px;
  min-width: 0;
}

.note h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.note p {
  margin: 0 0 8px;
}

.note ul {
  margin: 0 0 8px;
}

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

section.after h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

#askwrap {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#askwrap.ask-up {
  flex-direction: column-reverse;
}

#askwrap[hidden] {
  display: none;
}

#askIcon {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font: 700 12px/1 Manrope, "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
}

#askbar {
  width: min(220px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  border-width: 0;
  padding: 0 8px;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    max-height 0.22s ease,
    margin 0.2s ease,
    padding 0.2s ease,
    border-width 0.2s ease;
}

#askwrap.open #askbar {
  opacity: 1;
  max-height: 280px;
  overflow: visible;
  margin: 8px 0 0;
  padding: 8px;
  border-width: 1px;
  pointer-events: auto;
  transform: translateY(0);
}

#askwrap.ask-up.open #askbar {
  margin: 0 0 8px;
}

#askbar label {
  display: block;
  margin: 8px 0 4px;
  font-size: 11px;
}

#askQ {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  margin-bottom: 6px;
}

#askOut {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}

#askbar button {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.shot img {
  cursor: zoom-in;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.82);
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  padding: 24px 12px;
  cursor: zoom-out;
}

#lightbox[hidden] {
  display: none;
}

#lightbox img {
  justify-self: center;
  max-width: min(1100px, 100%);
  max-height: 90vh;
  border-radius: 8px;
  cursor: default;
}

.lb-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.lb-nav svg {
  display: block;
}

.lb-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

#lightbox .lb-nav[hidden] {
  visibility: hidden;
}

ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.terms {
  display: grid;
  gap: 10px;
}

.term {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.term b {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  h1 {
    font-size: 30px;
  }
  .beat {
    grid-template-columns: 44px 1fr;
    column-gap: 14px;
  }
  .notebook.hours .beat {
    grid-template-columns: 64px 1fr;
  }
}
