/* Practicalendar: the flip clock on the green wall. A deep olive wall, black
   flaps with light numerals, bone paper, and one lamp-yellow signal.
   Colors come from ArrivalPlanPalette.swift; type is Hanken Grotesk (OFL). */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/HankenGrotesk-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall: #3F4D3B;
  --ink: #F1EFE8;
  --ink-2: #C6CCBD;
  --flap: #1E1E1B;
  --flap-top: #282825;
  --flap-ink: #F1F0EB;
  --seam: #0B0B0A;
  --bone: #ECE8DF;
  --bone-ink: #191C17;
  --bone-ink-2: #5B6157;
  --signal: #F2C14E;
  --card: rgba(30, 30, 27, 0.45);
  --line: rgba(241, 239, 232, 0.14);
  --shadow: 0 18px 44px rgba(11, 11, 10, 0.35);
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 32px);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--wall);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  /* Flat, so the top of the page matches the browser's bar (theme-color) and the
     hero film's stage sits in it with no edge. */
  background: var(--wall);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(242, 193, 78, 0.38); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 68rem);
  margin-inline: auto;
}

.section { padding-block: clamp(56px, 9vw, 104px); }

.eyebrow {
  margin-bottom: clamp(28px, 5vw, 48px);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* A flip-clock flap: dark tile, slightly lighter top half, a seam across it. */
.flap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 76px;
  border-radius: 10px;
  background: linear-gradient(var(--flap-top) 0 50%, var(--flap) 50% 100%);
  box-shadow: 0 10px 24px rgba(11, 11, 10, 0.35);
  color: var(--flap-ink);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.flap::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 2px;
  margin-top: -1px;
  background: var(--seam);
}

/* ===== Hero ===== */
/* What it does first, then the name: the headline, the app's name, then the film
   and the rest. Wide screens put the film on the right. */
.hero {
  padding: clamp(14px, 3vw, 40px) 0 clamp(32px, 5vw, 56px);
  text-align: center;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "brand" "film" "copy";
  justify-items: center;
}

.brand {
  grid-area: brand;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* The film. Its canvas only draws the film; the wall behind it is the page.
   On phones it runs edge to edge, past the side gutters, and its 1:2 box trims
   a little wall off the stage's sides so the phone in it comes out bigger; the
   bottom of it may sit below the first screen. */
.hero-film {
  grid-area: film;
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  aspect-ratio: 1 / 2;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 521px) {
  .hero-film { width: min(560px, 55svh); margin-inline: 0; }
}
.hero-film canvas { display: block; }
.hero-film:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
  border-radius: 12px;
}
.film-mute:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.hero-copy {
  grid-area: copy;
  margin-top: 8px;
}

.hero h1 {
  grid-area: title;
  max-width: 15ch;
  margin: 0 auto 12px;
  font-size: clamp(2.6rem, 8vw, 5.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  max-width: 34rem;
  margin: 0 auto 30px;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.signal {
  color: var(--signal);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  text-align: left;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--flap);
  box-shadow: 0 8px 20px rgba(11, 11, 10, 0.25);
  color: var(--flap-ink);
  font-size: 0.975rem;
  font-weight: 600;
}
.availability::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
}

.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.975rem;
}
.trust li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.trust li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

@media (min-width: 900px) {
  .hero { text-align: left; }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas: ". film" "title film" "brand film" "copy film" ". film";
    column-gap: clamp(32px, 6vw, 96px);
    justify-items: start;
  }
  .hero h1 { margin-bottom: 18px; }
  .brand { margin-bottom: 26px; }
  .hero-film { width: min(40vw, calc((100svh - 64px) * 9 / 16), 560px); aspect-ratio: 9 / 16; }
  .hero-copy { margin-top: 0; }
  .hero h1,
  .lede { margin-inline: 0; }
  .trust { justify-content: flex-start; }
}

/* ===== Screenshots ===== */
.gallery { padding-bottom: clamp(40px, 7vw, 88px); }

.shots {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 12px var(--gutter) 28px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-color: rgba(241, 239, 232, 0.35) transparent;
  scrollbar-width: thin;
}

.shots li {
  flex: 0 0 min(66vw, 260px);
  scroll-snap-align: start;
}

.shots a {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.shots img {
  width: 100%;
  aspect-ratio: 804 / 1748;
  object-fit: cover;
}

@media (min-width: 960px) {
  .shots {
    justify-content: center;
    max-width: 82rem;
    margin-inline: auto;
    overflow: visible;
  }
  .shots li { flex: 1 1 0; max-width: 240px; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .shots a { transition: transform 0.25s ease, box-shadow 0.25s ease; }
  .shots a:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 54px rgba(11, 11, 10, 0.45);
  }
}

/* ===== How it works ===== */
.steps {
  border-block: 1px solid var(--line);
  background: rgba(30, 30, 27, 0.16);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(36px, 5vw, 56px);
  padding: 0;
  list-style: none;
  text-align: center;
}

.step .flap { margin-bottom: 22px; }

.step h3 {
  margin-bottom: 10px;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.step p {
  max-width: 22rem;
  margin-inline: auto;
  color: var(--ink-2);
}

/* ===== What it does ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.card p { color: var(--ink-2); }
.card p + p { margin-top: 14px; }
.card a { color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .step-list, .feature-grid { grid-template-columns: 1fr; }
}

/* ===== Built for ===== */
.built-for { text-align: center; }

.statement {
  max-width: 22ch;
  margin: 0 auto 16px;
  font-size: clamp(1.75rem, 4.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.built-for p:last-child {
  color: var(--ink-2);
  font-size: 1.125rem;
}

/* ===== Support ===== */
.support {
  border-top: 1px solid var(--line);
  text-align: center;
}

.support h2 {
  margin-bottom: 18px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.support p {
  max-width: 36rem;
  margin: 0 auto 12px;
  color: var(--ink-2);
}

.support .contact {
  margin-bottom: 20px;
  color: var(--ink);
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
}
.support .contact a { font-weight: 600; overflow-wrap: anywhere; }

/* ===== Footer ===== */
.site-footer {
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ===== Screenshot viewer ===== */
.lightbox {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop { background: rgba(11, 11, 10, 0.88); }

.lightbox img {
  width: auto;
  max-width: 92vw;
  max-height: 86vh;
  max-height: 86dvh;
  border-radius: 18px;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--flap);
  color: var(--flap-ink);
  font: 600 0.95rem/1 var(--font);
  cursor: pointer;
}

html:has(.lightbox[open]) { overflow: hidden; }

/* ===== Privacy policy: bone paper on the wall ===== */
.doc { padding: clamp(20px, 6vw, 64px) var(--gutter) clamp(40px, 7vw, 72px); }

.paper {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(22px, 6vw, 64px);
  border-radius: 24px;
  background: var(--bone);
  box-shadow: var(--shadow);
  color: var(--bone-ink);
}

.paper a {
  color: var(--wall);
  font-weight: 600;
  text-decoration-color: currentColor;
}

.paper :focus-visible { outline-color: var(--wall); }

.paper .back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--bone-ink-2);
  font-size: 0.95rem;
  text-decoration: none;
}
.paper .back:hover { color: var(--bone-ink); text-decoration: underline; }

.paper h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.paper .updated {
  margin-top: 10px;
  color: var(--bone-ink-2);
  font-size: 0.95rem;
}

.paper h2 {
  margin: 40px 0 12px;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.paper p + p { margin-top: 14px; }
.paper ul { margin: 12px 0 14px; padding-left: 1.25em; }
.paper li + li { margin-top: 6px; }
.paper strong { font-weight: 650; }

.highlight {
  margin-top: 32px;
  padding: clamp(16px, 3vw, 20px) clamp(16px, 3vw, 22px);
  border-left: 4px solid var(--wall);
  border-radius: 12px;
  background: rgba(63, 77, 59, 0.1);
}

/* ===== Not found ===== */
.not-found {
  padding: clamp(80px, 16vw, 160px) 0 clamp(64px, 10vw, 120px);
  text-align: center;
}

.not-found .flaps {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 32px;
}

.not-found h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.not-found p { color: var(--ink-2); font-size: 1.125rem; }
.not-found a { color: var(--ink); font-weight: 600; }
