/* GlobeTips site. Idea: the page is built from the app's own sheets. A white calculator sheet on the black
 * backdrop (hero: headline beside the calculator), white device sheets (iPhone Duo, iPad),
 * the dark guide sheet (serif rules, brass captions), then a white sheet for questions. Dashed dividers, right-aligned condensed figures and caption-over-title rows are
 * taken from CalculatorView; colours come from the icon (shirt, jacket, collar, buttons). */
@import url("./tokens.css");
@import url("./base.css");

body { background: #000; font-size: var(--text-md); line-height: 1.6; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.skip { position: absolute; left: var(--space-md); top: -100px; z-index: 10; padding: var(--space-xs) var(--space-md); background: var(--color-paper); color: var(--color-ink); border-radius: var(--space-xs); font-family: var(--font-ui); }
.skip:focus { top: var(--space-md); }
h3 { font-family: var(--font-ui); font-size: var(--text-lg); font-weight: 700; letter-spacing: 0; line-height: 1.3; }

/* Backdrop and nav: the black band above the sheets */
.backdrop { background: #000; color: var(--dark-ink); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding-block: var(--space-md) var(--space-lg); font-family: var(--font-ui); }
.brand { display: inline-flex; align-items: center; gap: var(--space-sm); text-decoration: none; font-weight: 700; font-size: var(--text-lg); border-radius: var(--space-xs); }
.brand img { width: 36px; height: 36px; border-radius: var(--radius-icon); }
.nav-links { display: flex; gap: var(--space-lg); margin-left: auto; font-size: var(--text-sm); font-weight: 600; }
.nav-links a { color: var(--dark-ink-2); text-decoration: none; border-radius: 4px; }
.nav-links a:hover { color: var(--dark-ink); }
.nav-badge { display: block; border-radius: 7px; flex: none; }
.nav-badge img { height: 40px; width: auto; }

/* Sheets: rounded top corners, edge to edge like the app's */
.sheet, .guide, .terms, #duo { border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
.sheet { background: var(--color-paper); color: var(--color-ink); }

/* Hero: the calculator sheet, headline on the left, the app rising from the sheet's bottom edge */
.hero { padding-block: var(--space-3xl); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-2xl); align-items: center; }
.hero-copy { display: grid; gap: var(--space-lg); justify-items: start; }
.badge { display: inline-block; border-radius: 9px; transition: transform var(--dur-micro) var(--ease-out); }
.badge:active { transform: scale(0.97); }
.hero h1 { font-size: var(--text-display); font-weight: 600; line-height: 1.02; max-width: 11ch; }
.hero .lead { color: var(--color-ink-2); max-width: 34ch; }
.hero-note { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 600; color: var(--color-muted); }
.hero-device { justify-self: end; width: min(100%, 340px); }

/* At the table: black backdrop with two phones */
.table { padding-block: var(--section-gap) var(--section-gap); }
.table h2 { color: var(--dark-ink); max-width: 18ch; }
.table-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-3xl); align-items: center; }
.table-copy .uses { margin-top: var(--space-2xl); }
.table-grid .iphone { justify-self: end; width: min(100%, 340px); }
.uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl) var(--gap-columns); }
.uses h3 { color: var(--collar); }
.uses p { margin-top: var(--space-xs); color: var(--dark-ink-2); }

/* iPhone 17 frame (402 × 874 pt screen, ~55 pt corners, Dynamic Island 125 × 37 pt), drawn in CSS around a
 * real 1206 × 2622 screenshot. Proportions are percentages of the screen, so the frame scales with its width. */
.iphone { position: relative; margin: 0; padding: 3.2%; border-radius: 16.5% / 7.6%; background: #050505;
  box-shadow: inset 0 0 0 1px #2a2a2c, 0 0 0 1.5px #6e6e73, 0 0 0 3px #2c2c2e, 0 0 0 3.5px #4a4a4e, 0 30px 70px -30px rgba(0,0,0,0.55); }
.iphone .screen { position: relative; aspect-ratio: 1206 / 2622; border-radius: 13.7% / 6.3%; overflow: hidden; background: #000; }
.iphone .screen img { width: 100%; height: 100%; object-fit: cover; }
.iphone .screen::after { content: ""; position: absolute; top: 1.3%; left: 50%; width: 31%; height: 4.2%; transform: translateX(-50%); border-radius: 999px; background: #000; }
.iphone::before, .iphone::after { content: ""; position: absolute; width: 3px; border-radius: 2px; }
.iphone::before { left: -5px; top: 17%; height: 25%;
  background: linear-gradient(#3a3a3e 0 13%, transparent 13% 24%, #3a3a3e 24% 57%, transparent 57% 67%, #3a3a3e 67% 100%); border-radius: 2px 0 0 2px; }
.iphone::after { right: -5px; top: 27%; height: 15%; background: #3a3a3e; border-radius: 0 2px 2px 0; }

/* Device sheets: iPhone Duo (its own section) and iPad */
.devices { background: var(--color-paper); color: var(--color-ink); position: relative; }
#duo { margin-top: calc(var(--radius-sheet) * -1); padding-block: var(--section-gap) var(--space-3xl); }
.ipad-section { padding-block: var(--space-2xl) calc(var(--section-gap) + var(--radius-sheet)); }
.devices-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2xl); align-items: end; }
.devices-head .lead { color: var(--color-ink-2); max-width: 44ch; }
.duo-row { margin-top: var(--space-2xl); display: grid; grid-template-columns: minmax(0, 3.1fr) minmax(0, 1fr); gap: var(--space-2xl); align-items: center; }
/* iPhone Duo open: one wide panel with a hinge line at the fold; closed: the narrower outer screen. */
.duo, .duo-closed, .ipad { position: relative; margin: 0; background: #050505;
  box-shadow: inset 0 0 0 1px #2a2a2c, 0 0 0 1.5px #6e6e73, 0 0 0 3px #2c2c2e, 0 0 0 3.5px #4a4a4e, 0 30px 70px -30px rgba(0,0,0,0.45); }
.duo { padding: 1.4%; border-radius: 4.2% / 6%; }
.duo .screen { aspect-ratio: 1600 / 1125; border-radius: 3% / 4.3%; overflow: hidden; }
.duo::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-1px); background: linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.08)); pointer-events: none; }
.duo-closed { padding: 4%; border-radius: 13% / 9%; }
.duo-closed .screen { aspect-ratio: 720 / 1047; border-radius: 10% / 7%; overflow: hidden; }
.ipad { margin-top: var(--space-2xl); padding: 1.8%; border-radius: 3.6% / 4.8%; }
.ipad .screen { aspect-ratio: 1600 / 1200; border-radius: 2.2% / 2.9%; overflow: hidden; }
.duo img, .duo-closed img, .ipad img { width: 100%; height: 100%; object-fit: cover; }

/* Guide sheet */
.guide { background: var(--guide-sheet); color: var(--dark-ink); padding-block: var(--section-gap); margin-top: calc(var(--radius-sheet) * -1); position: relative; }
.guide-lead { margin-top: var(--space-md); color: var(--dark-ink-2); font-size: var(--text-lead); max-width: 44ch; }
.rules { margin: var(--space-2xl) 0 0; display: grid; }
.rules > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.6fr); column-gap: var(--space-xl); align-items: baseline; padding-block: var(--space-lg); border-top: 1px dashed var(--dark-rule); }
.rules > div:last-child { border-bottom: 1px dashed var(--dark-rule); }
.rules dt { font-family: var(--font-ui); font-weight: 600; font-size: var(--text-lg); color: var(--brass); }
.rules dd { margin: 0; }
.rules .fig { font-family: var(--font-figure); font-size: clamp(2.75rem, 3vw + 1rem, 4rem); line-height: 0.9; }
.rules .txt { font-size: var(--text-lead); line-height: 1.45; color: var(--dark-ink-2); max-width: 40ch; }
.guide-note { margin-top: var(--space-xl); font-style: italic; color: var(--dark-muted); }

/* Questions sheet */
.terms { background: var(--color-paper); color: var(--color-ink); padding-block: var(--section-gap) var(--space-2xl); margin-top: calc(var(--radius-sheet) * -1); position: relative; }
.faq { margin-top: var(--space-2xl); border-top: 2px dashed var(--color-rule); }
.faq details { border-bottom: 2px dashed var(--color-rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-lg); padding-block: var(--space-lg); font-family: var(--font-display); font-size: var(--text-title); font-weight: 600; line-height: 1.25; border-radius: 4px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-family: var(--font-ui); font-weight: 400; color: var(--color-accent); transition: transform var(--dur-micro) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: var(--space-lg); color: var(--color-ink-2); font-size: var(--text-lead); max-width: 60ch; }
.faq a { color: var(--color-accent); }
.cta { margin-top: var(--space-3xl); display: flex; align-items: center; gap: var(--space-xl); }
.cta > div { display: grid; gap: var(--space-md); justify-items: start; }
.cta-icon { width: 96px; height: 96px; border-radius: var(--radius-icon); flex: none; }
.cta p { font-size: var(--text-lead); max-width: 38ch; }
.badge img { height: 52px; width: auto; }
.family { margin-top: var(--space-3xl); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-columns); font-family: var(--font-ui); }
.family a { display: grid; gap: 2px; padding-top: var(--space-md); border-top: 1px solid var(--color-rule); text-decoration: none; border-radius: 2px; }
.family a:hover strong { text-decoration: underline; text-underline-offset: 0.2em; }
.family span { color: var(--color-muted); font-size: var(--text-sm); }

.foot { background: var(--color-paper); color: var(--color-muted); font-family: var(--font-ui); font-size: var(--text-sm); padding-block: var(--space-lg) var(--space-xl); }
.foot .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm) var(--space-lg); border-top: 1px solid var(--color-rule); padding-top: var(--space-lg); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--space-md); }

/* Privacy page */
.doc { background: var(--color-paper); color: var(--color-ink); padding-block: var(--space-2xl) var(--space-3xl); }
.doc h1 { font-size: var(--text-section); margin-bottom: var(--space-lg); }
.doc h2 { font-size: var(--text-title); margin-top: var(--space-xl); margin-bottom: var(--space-sm); }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: var(--space-sm); }
.doc ul { padding-left: 1.2em; max-width: 65ch; }
.doc li + li { margin-top: var(--space-xs); }
.doc a { color: var(--color-accent); }
.doc .updated { color: var(--color-muted); margin-top: var(--space-xl); font-family: var(--font-ui); font-size: var(--text-sm); }

@media (max-width: 60rem) {
  :root { --section-gap: 88px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .hero-device { justify-self: center; width: min(78%, 320px); }
  .table-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .table-grid .iphone { justify-self: center; }
  .uses { padding-top: 0; }
  .devices-head { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .duo-row { grid-template-columns: minmax(0, 1fr); }
  .duo-closed { justify-self: center; width: min(60%, 260px); }
  .nav-links { display: none; }
  .rules > div { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-xs); }
  .rules .txt { grid-column: 1 / -1; }
  .rules .fig { justify-self: end; }
}
@media (max-width: 40rem) {
  :root { --radius-sheet: 22px; --section-gap: 72px; }
  .nav-badge img { height: 34px; }
  .uses { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: var(--space-2xl) var(--space-3xl); }
  .family { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
  .cta { flex-direction: column; align-items: flex-start; }
}

.rules .fig { font-variant-numeric: proportional-nums lining-nums; }

/* Motion (motion.js adds .motion and .loaded on <html>; without JS or with reduced motion nothing moves).
 * One load sequence in the hero (copy, then the phone rising into place), the iPhone Duo unfolding
 * from its hinge when it comes into view, the iPad settling in; the rest is feedback on hover and press. */
@media (prefers-reduced-motion: no-preference) {
  .motion .hero-copy > * { animation: rise 760ms var(--ease-out) both; }
  .motion .hero-copy > :nth-child(2) { animation-delay: 90ms; }
  .motion .hero-copy > :nth-child(3) { animation-delay: 180ms; }
  .motion .hero-copy > :nth-child(4) { animation-delay: 260ms; }
  .motion .hero-device .iphone { animation: phone-up 1150ms cubic-bezier(0.16, 1, 0.3, 1) 200ms backwards; }
  .hero-device .iphone { transition: transform 600ms var(--ease-out); will-change: transform; }

  .motion .duo-row .duo { clip-path: inset(-12px 47% -60px 47% round 28px); transition: clip-path 1250ms cubic-bezier(0.65, 0, 0.2, 1); }
  .motion .duo-row .duo img { transform: scale(1.06); transition: transform 1400ms var(--ease-out); }
  .motion .duo-row .duo::after { opacity: 1; background: linear-gradient(rgba(95,211,222,0.0), rgba(95,211,222,0.55) 50%, rgba(95,211,222,0)); transition: opacity 900ms ease 900ms; }
  .motion .duo-row .duo-closed { opacity: 0; transform: translateY(32px) rotate(-3deg); transition: opacity 700ms ease 650ms, transform 900ms var(--ease-out) 650ms; }
  .motion .duo-row.in .duo { clip-path: inset(-12px -12px -60px -12px round 28px); }
  .motion .duo-row.in .duo img { transform: none; }
  .motion .duo-row.in .duo::after { opacity: 0.35; background: linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.08)); }
  .motion .duo-row.in .duo-closed { opacity: 1; transform: none; }

  .motion .ipad { opacity: 0; transform: translateY(48px) scale(0.98); transition: opacity 800ms ease, transform 1000ms var(--ease-out); }
  .motion .ipad.in { opacity: 1; transform: none; }

  .table-grid .iphone, .duo-closed { transition: transform 500ms var(--ease-out); }
  .table-grid .iphone:hover { transform: translateY(-8px) rotate(1deg); }

  .faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 320ms var(--ease-out), content-visibility 320ms allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
}
:root { interpolate-size: allow-keywords; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes phone-up { from { opacity: 0; transform: translateY(64px); } }

/* Feedback on hover and press */
.badge:hover, .nav-badge:hover { transform: translateY(-2px); }
.nav-badge { transition: transform var(--dur-micro) var(--ease-out); }
.nav-badge:active, .badge:active { transform: scale(0.97); }
.nav-links a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 240ms var(--ease-out), color 160ms; }
.nav-links a:hover { background-size: 100% 1px; }
.rules > div { transition: background-color 240ms ease; }
.rules .fig, .rules .txt { transition: color 240ms ease, transform 320ms var(--ease-out); }
.rules > div:hover { background: rgba(245,166,35,0.05); }
.rules > div:hover .fig { color: var(--brass); transform: translateX(-6px); }
.rules > div:hover .txt { color: var(--dark-ink); }
.faq summary:hover { color: var(--color-accent); }
.faq summary::after { font-size: 1.4em; line-height: 1; }
.family a strong { transition: color 160ms; }
.family a:hover strong { color: var(--color-accent); }
