/* Sync My Watch: page styles. Tokens, layout, type, controls, hints, footer, consent. */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #ECEAE5;
  --bg-edge: #DCD8D1;
  --bg-glow: #F4F2EE;
  --fg: #1E2124;
  --fg-muted: #5F636A;
  --fg-faint: #8E9298;
  --hair: rgba(30, 33, 36, 0.16);
  --signal: #B8322A;
  --control-bg: rgba(255, 255, 255, 0.38);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.2l4 4 4-4' fill='none' stroke='%231E2124' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --display: 'Jost', 'Futura', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141518;
  --bg-edge: #0C0D0F;
  --bg-glow: #1C1D21;
  --fg: #E9E7E2;
  --fg-muted: #A4A7AD;
  --fg-faint: #70747A;
  --hair: rgba(233, 231, 226, 0.16);
  --signal: #D9463D;
  --control-bg: rgba(255, 255, 255, 0.04);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.2l4 4 4-4' fill='none' stroke='%23E9E7E2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 72% 56% at 50% 36%, var(--bg-glow) 0%, var(--bg) 52%, var(--bg-edge) 100%);
  pointer-events: none;
}
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
button { font-family: inherit; }

.page { max-width: 680px; margin: 0 auto; padding: 0 20px 40px; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: center; padding: 24px 0 4px; }
.wordmark { font: 600 23px/1 var(--display); letter-spacing: 0.05em; color: var(--fg); text-decoration: none; }
.wordmark:hover { text-decoration: none; }

/* Hero: the watch and its caption */
.hero { text-align: center; padding-top: 30px; }
.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; }
.readout { margin-top: 12px; }
.ro-time {
  font: 500 clamp(44px, 10vw, 66px)/1.05 var(--display);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  margin: 0;
}
.ro-time.is-placeholder { color: var(--fg-faint); }
.ro-time .ampm { font-size: 0.4em; margin-left: 0.2em; letter-spacing: 0.06em; }
.ro-date { margin: 4px 0 0; font-size: 16px; }
.ro-zone { margin: 2px 0 0; font-size: 15px; color: var(--fg-muted); }
.ro-zone .offset, .ro-second .offset { font-weight: 500; color: var(--fg); margin-right: 0.5em; }
.ro-second { margin: 4px 0 0; font-size: 15px; color: var(--fg-muted); min-height: 1.6em; }
.ro-second.is-off { visibility: hidden; }
.ro-status { margin: 12px 0 0; font-size: 13px; color: var(--fg-muted); }
.ro-status:empty { display: none; }
.ro-status.is-warning { color: var(--signal); }
.ro-status.is-syncing::after { content: '\2026'; display: inline-block; width: 1.2em; text-align: left; animation: ellipsis 1.2s steps(4, end) infinite; }
@keyframes ellipsis { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 -0.2em 0 0); } }

/* Controls: a label column and a field column; the buttons sit in the field column so they
   share the selects' left edge. The second-zone row exists only while the GMT hand is on. */
.controls { display: grid; grid-template-columns: auto 250px; column-gap: 10px; row-gap: 10px; align-items: center; width: max-content; max-width: 100%; margin: 22px auto 0; }
.control-label { font-size: 13px; color: var(--fg-muted); white-space: nowrap; text-align: right; }
.controls-toggles { grid-column: 2; display: flex; gap: 10px; margin-top: 2px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  font: 500 14px/1.2 var(--sans);
  color: var(--fg);
  background: var(--control-bg) var(--chevron) no-repeat right 12px center / 12px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 9px 34px 9px 14px;
  width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.toggle {
  font: 500 14px/1.2 var(--sans);
  color: var(--fg);
  background: var(--control-bg);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.text-button { font: 500 13px/1 var(--sans); color: var(--fg-muted); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Notice (date-setting warning) */
.notice { text-align: left; margin: 22px auto 0; max-width: 560px; padding: 10px 16px 10px 18px; border-left: 2px solid var(--signal); font-size: 15px; }
.notice p { margin: 0 0 6px; }
.notice .text-button { color: var(--fg); }

/* Hints */
.hints, .about { text-align: left; }
.hints { margin-top: 56px; }
.about { margin-top: 44px; }
.hints h2, .about h2 { font: 500 27px/1.2 var(--display); letter-spacing: 0.01em; margin: 0 0 6px; }
.hints .lead { color: var(--fg-muted); margin: 0 0 20px; }
.hint { padding: 18px 0 20px; border-top: 1px solid var(--hair); }
.hint h3 { font: 500 20px/1.3 var(--display); margin: 0 0 6px; }
.hint p { margin: 0; }
.hint p + p { margin-top: 8px; }
.hint[hidden] { display: none; }
.windows { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.windows th, .windows td { text-align: left; padding: 7px 10px 7px 0; border-top: 1px solid var(--hair); vertical-align: top; }
.windows th { font-weight: 500; color: var(--fg-muted); border-top: 0; padding-top: 0; }
.windows td:nth-child(2) { white-space: nowrap; }
.windows a { color: var(--fg-muted); }
.about p { margin: 0 0 12px; }

/* Footer */
.site-footer { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--hair); text-align: center; font-size: 13px; color: var(--fg-muted); }
.site-footer nav a { color: var(--fg-muted); margin: 0 10px; }
.site-footer .credit { margin: 12px 0 0; }
.site-footer .credit a { color: var(--fg); text-decoration: none; }
.site-footer .credit a:hover { text-decoration: none; }
.aws-logo-link { display: inline-block; margin-top: 16px; line-height: 0; }
.aws-logo { height: 30px; width: 83px; display: block; margin: 0 auto; }
.aws-logo-dark { display: none; }
[data-theme="dark"] .aws-logo-light { display: none; }
[data-theme="dark"] .aws-logo-dark { display: block; }

/* Consent banner: fixed at the bottom and never moves; the page gets bottom padding while it is open */
#consent-banner {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--bg);
  color: var(--fg);
  border-top: 1px solid var(--hair);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  font-size: 14px;
}
#consent-banner.consent-visible { display: block; }
body.consent-open { padding-bottom: var(--consent-height, 0px); }
.consent-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.consent-inner p { margin: 0; flex: 1 1 320px; color: var(--fg-muted); }
.consent-inner p a { color: var(--fg); }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .toggle { min-height: 44px; }
.consent-actions .toggle.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Secondary pages (terms, privacy, 404) */
.prose { text-align: left; max-width: 640px; }
.prose h1 { font: 500 34px/1.15 var(--display); margin: 28px 0 8px; }
.prose h2 { font: 500 22px/1.25 var(--display); margin: 30px 0 8px; }
.prose p, .prose li { margin: 0 0 12px; }
.prose .updated { color: var(--fg-muted); font-size: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 7px 10px 7px 0; border-top: 1px solid var(--hair); vertical-align: top; }
.prose th { font-weight: 500; color: var(--fg-muted); border-top: 0; }
.back-link { display: inline-block; margin-top: 18px; font-size: 14px; }

@media (max-width: 560px) {
  .windows thead { display: none; }
  .windows tr { display: block; padding: 8px 0; border-top: 1px solid var(--hair); }
  .windows td { display: block; border: 0; padding: 1px 0; }
  .windows td:nth-child(2) { font-weight: 500; white-space: normal; }
}
@media (max-width: 480px) {
  .controls { grid-template-columns: 1fr; width: 100%; row-gap: 4px; }
  .control-label { text-align: left; }
  .control-label + .select { margin-bottom: 8px; }
  .select { width: 100%; }
  .controls-toggles { grid-column: 1; margin-top: 4px; }
  .site-header { padding-top: 18px; }
  .wordmark { font-size: 21px; }
  .hints h2, .about h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .ro-status.is-syncing::after { animation: none; clip-path: none; }
}

/* Render mode for the social image: only the watch and the wordmark, 1200 by 630 */
body.og-mode { overflow: hidden; }
body.og-mode .controls, body.og-mode .notice, body.og-mode .hints,
body.og-mode .about, body.og-mode .site-footer, body.og-mode #consent-banner, body.og-mode .ro-status { display: none; }
body.og-mode .page { max-width: none; width: 1200px; height: 630px; padding: 0 70px 0 60px; display: grid; grid-template-columns: 540px 1fr; align-items: center; gap: 44px; }
body.og-mode main, body.og-mode .hero { display: contents; }
body.og-mode .visually-hidden { display: none; }
body.og-mode .watch { width: 540px; margin: 0; }
body.og-mode .readout { text-align: left; margin: 0; }
body.og-mode .og-title { display: block; font: 500 62px/1.05 var(--display); letter-spacing: 0.04em; margin: 0 0 18px; }
body.og-mode .og-tagline { display: block; font: 400 26px/1.2 var(--sans); color: var(--fg-muted); margin: 0 0 22px; white-space: nowrap; }
body.og-mode .ro-time { font-size: 92px; }
body.og-mode .ro-date, body.og-mode .ro-zone { font-size: 22px; }
.og-title, .og-tagline { display: none; }

/* Render mode for the icons: only the watch head, flat background, no page vignette or shadow */
body.icon-mode { overflow: hidden; }
body.icon-mode::before { display: none; }
body.icon-mode .page { max-width: none; padding: 0; }
body.icon-mode main, body.icon-mode .hero { display: contents; }
body.icon-mode .readout, body.icon-mode .controls, body.icon-mode .notice, body.icon-mode .hints,
body.icon-mode .about, body.icon-mode .site-footer, body.icon-mode #consent-banner, body.icon-mode .visually-hidden { display: none; }
body.icon-mode .watch { width: 1000px; margin: 0; }
body.icon-mode .watch-shadow { display: none; }
body.icon-mode.bg-black { background: #000; }
body.icon-mode.bg-white { background: #fff; }
