/* Philley Labs — one stylesheet for every page. Dark only, no third-party requests. */

@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/chakra-petch-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/chakra-petch-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/chakra-petch-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Grenze Gotisch"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/grenze-gotisch-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;

  /* The app's twelve colors */
  --red: #FF3B3B;
  --orange: #FF8A1F;
  --amber: #FFC21A;
  --lime: #39FF14;
  --green: #1FE07A;
  --teal: #00D4BE;
  --sky: #1EC8FF;
  --blue: #3D7DFF;
  --indigo: #6E5CFF;
  --purple: #B54DFF;
  --pink: #FF3D9E;
  --snow: #E9EEF5;

  /* Ground, matching the app icon */
  --bg: #0A0A0A;
  --raised: #131416;
  --empty-day: #1A1C20;
  --line: #2A2D33;
  --muted: #A2AAB8;
  --faint: #7D8493;

  --text: "Chakra Petch", system-ui, sans-serif;
  --title: "Grenze Gotisch", "Chakra Petch", serif;

  --measure: 40rem;
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--snow);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img { display: block; max-width: 100%; height: auto; }

/* ---------- The twelve-color strip ---------- */

.strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  height: 6px;
}
.strip span:nth-child(1)  { background: var(--red); }
.strip span:nth-child(2)  { background: var(--orange); }
.strip span:nth-child(3)  { background: var(--amber); }
.strip span:nth-child(4)  { background: var(--lime); }
.strip span:nth-child(5)  { background: var(--green); }
.strip span:nth-child(6)  { background: var(--teal); }
.strip span:nth-child(7)  { background: var(--sky); }
.strip span:nth-child(8)  { background: var(--blue); }
.strip span:nth-child(9)  { background: var(--indigo); }
.strip span:nth-child(10) { background: var(--purple); }
.strip span:nth-child(11) { background: var(--pink); }
.strip span:nth-child(12) { background: var(--snow); }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose { max-width: var(--measure); }

/* ---------- Header and footer ---------- */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.wordmark {
  font-family: var(--title);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--snow);
  text-decoration: none;
  display: inline-block;
  padding: 0.625rem 0;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  display: inline-block;
  padding: 0.625rem 0;
}
.site-nav a:hover { color: var(--snow); }
.site-nav a[aria-current="page"] { color: var(--snow); box-shadow: inset 0 -2px 0 var(--snow); }

.site-footer { margin-top: 6rem; border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--faint);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--muted); text-decoration: none; display: inline-block; padding: 0.625rem 0; }
.site-footer a:hover { color: var(--snow); }

/* ---------- Type ---------- */

h1, h2 {
  font-family: var(--title);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(3.25rem, 9vw, 6rem); }
h2 { font-size: clamp(2rem, 5vw, 2.75rem); margin-top: 4rem; margin-bottom: 1.25rem; }

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2.25rem 0 0.5rem;
}

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--faint); }
strong { font-weight: 600; }

.lede { font-size: clamp(1.1875rem, 2.4vw, 1.4375rem); line-height: 1.45; color: var(--snow); max-width: 34rem; }
.muted { color: var(--muted); }

a { color: var(--snow); text-decoration-color: var(--faint); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--snow); }

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

/* ---------- Home ---------- */

.home-hero { padding-top: clamp(4rem, 14vw, 9rem); }
.home-hero h1 { font-size: clamp(4rem, 15vw, 10.5rem); line-height: 0.82; }
.home-hero .lede { margin-top: 1.5rem; color: var(--muted); }

.app-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.app-list > li { margin: 0; border-bottom: 1px solid var(--line); }

.app-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem 0;
  color: inherit;
  text-decoration: none;
}
.app-row h3 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.app-row p { margin: 0; color: var(--muted); }
.app-row .status { margin-top: 0.5rem; font-size: 0.875rem; color: var(--faint); }
.app-row:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.app-icon {
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line);
}

/* ---------- Second ---------- */

.app-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 2rem;
  align-items: center;
}
.app-hero .app-icon { width: clamp(5rem, 12vw, 7.5rem); }
.app-hero .lede { grid-column: 1 / -1; margin: 0.5rem 0 0; }
.app-hero .get { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0.5rem 0 0; }

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--snow);
}
/* A status, not a button: a small amber dot until the App Store badge replaces it. */
.store-soon::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--amber); }
.price { color: var(--muted); font-weight: 500; }

/* Features */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.features > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .features > div { grid-template-columns: 15rem 1fr; }
}
.features dt { font-weight: 600; font-size: 1.125rem; }
.features dd { margin: 0; color: var(--muted); max-width: 36rem; }

/* ---------- Documents (privacy, support) ---------- */

.doc { padding-top: clamp(2.5rem, 8vw, 4.5rem); }
.doc h1 { font-size: clamp(2.75rem, 8vw, 4.75rem); }
.doc .meta { color: var(--muted); margin: 1rem 0 0; }
.doc h2 { font-size: clamp(1.75rem, 4.5vw, 2.25rem); margin-top: 3rem; margin-bottom: 0.75rem; }
.doc p, .doc li { color: #D3D9E2; }

.summary {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--raised);
  border-left: 3px solid var(--snow);
}
.summary p:last-child { margin-bottom: 0; }

.contact-email { font-size: clamp(1.25rem, 4vw, 1.75rem); font-weight: 600; margin: 1.5rem 0 0.5rem; word-break: break-word; }

.faq { border-top: 1px solid var(--line); margin-top: 1rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-weight: 600;
  font-size: 1.125rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.375rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 1.25rem; }
.faq .answer p:last-child, .faq .answer ol:last-child, .faq .answer ul:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */

.lost { padding-top: clamp(4rem, 14vw, 9rem); }
.lost p { margin-top: 1.25rem; color: var(--muted); }

@media (max-width: 560px) {
  .app-row { grid-template-columns: 4rem 1fr; gap: 1rem; align-items: start; }
  .app-row h3 { font-size: 1.3125rem; }
}

/* The lowercase i of names like iCloud and iPhone stays lowercase in all-caps titles: <span class="lower">i</span>Cloud → iCLOUD. */
.lower { text-transform: none; }

/* The year preview: the app's year view (YearView.swift, DayCell.swift), drawn in HTML. */

.second-hero { display: grid; gap: 3rem; align-items: center; padding-top: clamp(2.5rem, 8vw, 5rem); }
.second-hero .app-hero { padding-top: 0; }
@media (min-width: 900px) {
  .second-hero { grid-template-columns: 1fr 25rem; gap: 4rem; align-items: start; }
  .second-hero .app-hero { padding-top: 4rem; }
}

.screen { margin: 0; width: 100%; max-width: 25rem; justify-self: center; }
.app {
  container-type: inline-size;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 2.5rem;
  padding: 1.5rem 0.9rem 1.1rem;
  color: #fff;
}
/* Sizes in cqi follow the app's points on a 390pt-wide iPhone: 1pt = 0.2564cqi. */
.yh { display: flex; align-items: center; justify-content: space-between; height: 13.3cqi; padding: 0 1cqi; margin-bottom: 3.1cqi; }
.yh span { font-family: var(--title); font-weight: 700; font-size: 11.8cqi; line-height: 1; }
.yh svg { width: 2.6cqi; height: 4.2cqi; color: #fff; }
.qs { display: grid; gap: 4.1cqi; }
.q { display: grid; gap: 1.55cqi; }
.qr { display: flex; align-items: center; gap: 1.55cqi; margin: 0; font-size: 2.8cqi; font-weight: 600; line-height: 1; color: rgba(235, 235, 245, 0.6); }
.qr::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.15); }
.mr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.56cqi; }
.mn { margin: 0; font-family: var(--title); font-weight: 700; font-size: 3.85cqi; line-height: 4.6cqi; color: var(--mc); }
.mn::after { content: ""; display: block; height: 1.5px; margin-top: 0.5cqi; background: var(--mc); opacity: 0.8; }
.wk, .dg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.wk { margin: 1cqi 0; }
.wk u { text-decoration: none; text-align: center; font-size: 2.3cqi; font-weight: 600; line-height: 1.2; color: rgba(235, 235, 245, 0.6); }
.wk u.we { color: rgba(235, 235, 245, 0.51); }
.dg i, .kd {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 2px;
  background: #1C1C1E;
  font-style: normal;
  font-size: 2.05cqi;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.dg i.x { background: transparent; }
.n { position: absolute; width: 34%; height: 34%; background: var(--k); }
.n.tl { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.n.tr { top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.n.bl { bottom: 0; left: 0; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.n.br { bottom: 0; right: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.lb { display: flex; align-items: center; gap: 2.56cqi; margin-top: 4.1cqi; padding-top: 1.55cqi; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.lt { font-family: var(--title); font-weight: 700; font-size: 4.1cqi; line-height: 1; }
.lms { flex: 1; display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.lm { flex: none; margin: 0 1.4cqi; font-style: normal; border-radius: 2px; }
.lm-box { position: relative; width: 2.56cqi; height: 2.56cqi; background: #2C2C2E; overflow: hidden; }
.lm-date { width: 4.1cqi; height: 3.6cqi; display: flex; align-items: center; justify-content: center; font-size: 2.3cqi; font-weight: 700; background: #2C2C2E; letter-spacing: -0.03em; }
.lsep { flex: none; width: 1px; height: 3.1cqi; margin: 0 0.4cqi; background: rgba(255, 255, 255, 0.22); }
.lb svg { flex: none; width: 3.9cqi; height: 3.9cqi; color: rgba(235, 235, 245, 0.6); }

.screen figcaption { margin-top: 1.25rem; }
.key { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; font-size: 0.9375rem; color: var(--muted); }
.key li { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.kd { flex: none; width: 1.75rem; font-size: 0.75rem; border-radius: 3px; }
.kd.ol-lime { box-shadow: inset 0 0 0 2px var(--ol); }
.screen .cap { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--faint); }

.m-red { --mc: var(--red); }
.k-red { --k: var(--red); }
.sh-red { background: #521313 !important; box-shadow: inset 0 0 0 1px #CC2F2F; }
.dc-red { color: var(--red) !important; font-weight: 700; }
.ol-red { --ol: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.m-orange { --mc: var(--orange); }
.k-orange { --k: var(--orange); }
.sh-orange { background: #522C0A !important; box-shadow: inset 0 0 0 1px #CC6E19; }
.dc-orange { color: var(--orange) !important; font-weight: 700; }
.ol-orange { --ol: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.m-amber { --mc: var(--amber); }
.k-amber { --k: var(--amber); }
.sh-amber { background: #523E08 !important; box-shadow: inset 0 0 0 1px #CC9B15; }
.dc-amber { color: var(--amber) !important; font-weight: 700; }
.ol-amber { --ol: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber); }
.m-lime { --mc: var(--lime); }
.k-lime { --k: var(--lime); }
.sh-lime { background: #125206 !important; box-shadow: inset 0 0 0 1px #2ECC10; }
.dc-lime { color: var(--lime) !important; font-weight: 700; }
.ol-lime { --ol: var(--lime); box-shadow: inset 0 0 0 1.5px var(--lime); }
.m-green { --mc: var(--green); }
.k-green { --k: var(--green); }
.sh-green { background: #0A4827 !important; box-shadow: inset 0 0 0 1px #19B362; }
.dc-green { color: var(--green) !important; font-weight: 700; }
.ol-green { --ol: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.m-teal { --mc: var(--teal); }
.k-teal { --k: var(--teal); }
.sh-teal { background: #00443D !important; box-shadow: inset 0 0 0 1px #00AA98; }
.dc-teal { color: var(--teal) !important; font-weight: 700; }
.ol-teal { --ol: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
.m-sky { --mc: var(--sky); }
.k-sky { --k: var(--sky); }
.sh-sky { background: #0A4052 !important; box-shadow: inset 0 0 0 1px #18A0CC; }
.dc-sky { color: var(--sky) !important; font-weight: 700; }
.ol-sky { --ol: var(--sky); box-shadow: inset 0 0 0 1.5px var(--sky); }
.m-blue { --mc: var(--blue); }
.k-blue { --k: var(--blue); }
.sh-blue { background: #142852 !important; box-shadow: inset 0 0 0 1px #3164CC; }
.dc-blue { color: var(--blue) !important; font-weight: 700; }
.ol-blue { --ol: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.m-indigo { --mc: var(--indigo); }
.k-indigo { --k: var(--indigo); }
.sh-indigo { background: #231D52 !important; box-shadow: inset 0 0 0 1px #584ACC; }
.dc-indigo { color: var(--indigo) !important; font-weight: 700; }
.ol-indigo { --ol: var(--indigo); box-shadow: inset 0 0 0 1.5px var(--indigo); }
.m-purple { --mc: var(--purple); }
.k-purple { --k: var(--purple); }
.sh-purple { background: #3A1952 !important; box-shadow: inset 0 0 0 1px #913ECC; }
.dc-purple { color: var(--purple) !important; font-weight: 700; }
.ol-purple { --ol: var(--purple); box-shadow: inset 0 0 0 1.5px var(--purple); }
.m-pink { --mc: var(--pink); }
.k-pink { --k: var(--pink); }
.sh-pink { background: #521433 !important; box-shadow: inset 0 0 0 1px #CC317E; }
.dc-pink { color: var(--pink) !important; font-weight: 700; }
.ol-pink { --ol: var(--pink); box-shadow: inset 0 0 0 1.5px var(--pink); }
.m-snow { --mc: var(--snow); }
.k-snow { --k: var(--snow); }
.sh-snow { background: #4B4C4E !important; box-shadow: inset 0 0 0 1px #BABEC4; }
.dc-snow { color: var(--snow) !important; font-weight: 700; }
.ol-snow { --ol: var(--snow); box-shadow: inset 0 0 0 1.5px var(--snow); }
.dg i[class*='sh-'][class*='ol-'] { box-shadow: inset 0 0 0 1.5px var(--ol); }
