/* World Clock Widget Hugo Theme */

:root {
  --accent: #FF3B30;
  --accent-soft: #E0342B;
  --bg: linear-gradient(180deg, #000000, #0a0a0a);
  --bg-solid: #0a0a0a;
  --card: #111111;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --border: #222222;
  --max-width: 800px;
  --max-width-wide: 1200px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-solid: #ffffff;
    --card: #f5f7fb;
    --text: #0b0c10;
    --muted: #4b5563;
    --border: #e5e7eb;
  }
  .card, .review { box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); }
}

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

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color 120ms ease; }
a:hover { color: var(--accent-soft); }

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

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max-width); margin: 0 auto; }
.wrap-wide { max-width: var(--max-width-wide); }

section { padding: 40px 20px; }

/* Site Header */
.site-header { padding: 20px; background: var(--bg-solid); border-bottom: 1px solid var(--border); }
.site-header .wrap { max-width: var(--max-width-wide); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand-link { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand-link:hover { color: var(--text); }
.logo { width: 40px; height: 40px; border-radius: 10px; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* Hamburger Button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.mobile-nav-overlay.open { display: block; }

.mobile-nav-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: var(--bg-solid, var(--card));
  padding: 80px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-menu a {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms ease;
}

.mobile-nav-menu a:hover { background: var(--card); color: var(--text); }

/* Hamburger on hero pages (homepage) */
.hamburger-btn--hero {
  display: flex;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1001;
}

.hamburger-btn--hero span { background: #ffffff; }

/* Homepage Header / Hero */
header {
  padding: 80px 20px 40px;
  position: relative;
  background: linear-gradient(180deg, #1a1a1a, #000000);
  color: #ffffff;
}

.hero { display: flex; flex-direction: column; gap: 28px; align-items: center; text-align: center; }

.hero-figure { position: relative; display: flex; justify-content: center; align-items: center; isolation: isolate; }

.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 16px; font-weight: 700; color: #ffffff; }

.brand .icon-frosted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.brand .icon-frosted img { width: 92px; height: 92px; border-radius: 20px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}

/* The clock is the hero: as big as fits, up to 480px. The face's corners are a fifth of its size. */
.brand .hero-clock-wrap { --clock-size: min(80vw, 60vh, 480px); border-radius: calc(var(--clock-size) / 5 + 4px); padding: 3px; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }

/* Clock colours come from the theme vars that index.html builds from data/themes.toml */
#hero-clock { display: block; width: var(--clock-size); height: var(--clock-size); fill: var(--clock-minute); }
#hero-clock rect { fill: var(--clock-face); }
#clock-hour { stroke: var(--clock-hour); }
#clock-minute { stroke: var(--clock-minute); }
#clock-second { stroke: var(--clock-second); }
#clock-nub { fill: var(--clock-second); }
#clock-screw { fill: var(--clock-screw); }

/* Settings menu and full-screen button, under the clock */
.clock-controls { position: relative; display: flex; gap: 10px; color: #fff; }
.clock-menu summary, .clock-fs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.1);
  color: inherit;
  list-style: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.clock-menu summary::-webkit-details-marker { display: none; }
.clock-menu summary:hover, .clock-menu[open] summary, .clock-fs-btn:hover { background-color: rgba(255, 255, 255, 0.18); }
.clock-fs-btn .icon-exit, .clock-fs .clock-fs-btn .icon-enter { display: none; }
.clock-fs .clock-fs-btn .icon-exit { display: block; }

/* Drops below the controls, so the clock stays in view (in full screen it pops up from the corner) */
.clock-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  width: 280px;
  padding: 6px;
  translate: -50% 0;
  border-radius: 14px;
  background: #1c1c1e;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  color: #fff;
  color-scheme: dark;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}
.clock-menu fieldset { margin: 0 0 6px; padding: 0 0 6px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.clock-menu legend { padding: 6px 8px 2px; color: #8e8e93; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.clock-menu-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.clock-menu-row:hover { background: rgba(255, 255, 255, 0.08); }
.clock-menu-row input { margin: 0 0 0 auto; accent-color: var(--accent); }
.theme-options { display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 52px;
  padding: 4px 0;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.theme-option:has(:checked) { color: #fff; }
/* The radio stays focusable and keyboard-operable; the mini face shows its state */
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option input:checked + .theme-dot { outline: 2px solid #fff; outline-offset: 2px; }
.theme-option input:focus-visible + .theme-dot { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A theme as a mini face */
.theme-dot {
  width: 26px;
  height: 26px;
  border: 2px solid var(--clock-minute);
  border-radius: 50%;
  background: radial-gradient(circle, var(--clock-second) 0 3px, var(--clock-face) 3.5px);
}

/* Show Seconds off, as in the app: no second hand, and the nub and current hour take the hour and accent colours */
.no-seconds #clock-second { display: none; }
.no-seconds #clock-nub { fill: var(--clock-hour); }
.no-seconds #clock-numeral { fill: var(--clock-accent); }

/* Full screen: like the app, the face colour fills the screen */
.clock-fs, .clock-fs body { overflow: hidden; }
.clock-fs .brand .hero-clock-wrap {
  position: fixed;
  inset: 0;
  z-index: 2000;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: var(--clock-face);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.clock-fs .hero-clock-wrap a { width: 100%; height: 100%; pointer-events: none; }
.clock-fs #hero-clock { width: 100%; height: 100%; }
/* The controls stay, faint, in a corner and in the theme's colours */
.clock-fs .clock-controls {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2001;
  color: var(--clock-minute);
  opacity: 0.35;
  transition: opacity 200ms ease;
}
.clock-fs .clock-controls:is(:hover, :focus-within, :has([open])) { opacity: 1; }
.clock-fs .clock-menu summary, .clock-fs .clock-fs-btn { background-color: transparent; }
.clock-fs .clock-menu-panel { top: auto; bottom: calc(100% + 8px); left: auto; right: 0; translate: none; }

/* Desktop: a grip at the bottom of the black area to drag the clock's size */
.hero-resize { display: none; }
@media (hover: hover) and (pointer: fine) {
  .hero-resize {
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 64px;
    height: 20px;
    translate: -50% 0;
    cursor: ns-resize;
    touch-action: none;
  }
  .hero-resize::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 16px;
    right: 16px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    transition: background-color 120ms ease;
  }
  .hero-resize:hover::before { background: rgba(255, 255, 255, 0.45); }
}

.title { font-size: clamp(32px, 6vw, 60px); line-height: 1.08; margin: 14px 0 28px; color: var(--text); }

.hero-shot { position: relative; padding: 0; border-radius: 24px; background: none; border: none; z-index: 1; }

/* CTA Elements */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }

.app-badge {
  display: inline-block;
  border-radius: 14px;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 12px 40px rgba(0, 122, 255, 0.35);
}

.app-badge:hover { transform: translateY(-1px); box-shadow: 0 16px 48px rgba(0, 122, 255, 0.42); }
.app-badge:active { transform: translateY(0); box-shadow: 0 10px 32px rgba(0, 122, 255, 0.3); }
.app-badge img { height: 6em; width: auto; display: block; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: background 120ms ease, transform 120ms ease;
}

.btn:hover { background: var(--accent-soft); color: #fff; transform: translateY(-1px); }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; text-align: center; }

.card { padding: 18px; border-radius: 0; background: transparent; border: none; box-shadow: none; }

.card h3 { margin: 0 0 10px; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Reviews */
.reviews { column-width: 280px; column-gap: 18px; max-width: var(--max-width); margin: 0 auto; }

.rating-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: -6px 0 18px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.rating-row .stars { display: inline-flex; align-items: center; justify-content: center; color: #ffd166; line-height: 1; }
.rating-row .stars svg { height: 28px; width: auto; display: block; }

.review { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); break-inside: avoid; margin: 0 0 16px; }

.review blockquote { position: relative; margin: 0 0 12px; padding: 22px 14px 0; color: var(--muted); line-height: 1.65; font-size: 16px; }

.review blockquote::before {
  content: "\201C";
  position: absolute;
  top: -6px;
  left: -2px;
  font-size: 56px;
  line-height: 1;
  opacity: 0.28;
  color: var(--text);
  pointer-events: none;
}

.review .name { font-weight: 700; color: var(--text); }
.review .name::after { content: " \2605\2605\2605\2605\2605"; color: #ffd166; }

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { padding: 16px 0; font-weight: 700; cursor: pointer; }
.faq details p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }

/* Content Pages */
.content { max-width: 65ch; margin: 0 auto; padding: 0 20px; }
.content h1, .content h2, .content h3, .content h4 { margin-top: 1.5em; }
.content h1:first-child, .content h2:first-child { margin-top: 0; }
.content a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.content img { border-radius: 12px; margin: 1.5em 0; }
.content blockquote { margin: 1.5em 0; padding: 0 0 0 1.5em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }

/* 404 Page */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-page h1 { font-size: 120px; line-height: 1; color: var(--accent); margin: 0; }
.error-page p { font-size: 24px; color: var(--muted); margin: 0 0 24px; }

/* Footer */
footer { padding: 26px 20px 40px; color: var(--muted); }
footer .wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
footer .links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; }
footer .links a { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; text-decoration-line: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); text-underline-offset: 4px; opacity: 0.9; color: var(--muted); }
footer .links a:hover { opacity: 1; color: var(--text); }
footer .footer-cta { margin-bottom: 20px; }
footer .footer-cta .app-badge { box-shadow: none; }
footer .footer-cta .app-badge img { height: auto; }
footer .legal { font-size: 14px; line-height: 1.5; margin: 1em; }

/* Responsive */
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .reviews { column-width: 240px; }
  .nav-links { display: none; }
  .hamburger-btn { display: flex; }
  .site-header { display: none; }
}

@media (max-width: 640px) {
  header { padding: 64px 18px 32px; }
  .hero-shot img { max-height: 320px; width: auto; }
  .cta-row { flex-direction: column; align-items: center; justify-content: center; }
}
