  :root {
    --bg: #f5f2ec;
    --card-bg: #ffffff;
    --text: #2c2416;
    --text-muted: #6b5e4a;
    --accent: #c4672e;
    --sea: #1a6b7a;
    --sea-light: #e4f0f2;
    --shadow-md: 0 4px 24px rgba(44,36,22,.09);
    --shadow-lg: 0 12px 48px rgba(44,36,22,.12);
    --radius: 18px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
  }

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

  html { font-size: 16px; scroll-behavior: smooth; }

  body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
      radial-gradient(ellipse at 15% 5%, rgba(26,107,122,.06) 0%, transparent 55%),
      radial-gradient(ellipse at 85% 95%, rgba(196,103,46,.05) 0%, transparent 55%);
  }

  /* ── Header ── */
  .hero {
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem) 1.5rem clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    min-height: 360px; /* prevent layout shift from dynamic content */
  }

  .hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--sea), var(--accent));
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--sea-light);
    color: var(--sea);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 1rem;
  }

  .hero-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #e85050;
    animation: pulse-dot 1.8s ease-in-out infinite;
  }

  @keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(232,80,80,.4); }
    50% { opacity: .6; box-shadow: 0 0 0 8px rgba(232,80,80,0); }
  }

  .hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    line-height: 1.2;
  }

  .hero h1 span {
    background: linear-gradient(135deg, var(--accent) 0%, #d47840 60%, var(--sea) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .hero p {
    color: var(--text-muted);
    margin-top: .5rem;
    font-size: 1rem;
    max-width: 480px;
    margin-inline: auto;
  }

  /* ── Conditions row (clock + weather) ── */
  .hero-conditions {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 1rem;
    flex-wrap: wrap;
  }

  /* ── Clock ── */
  .hero-clock {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .85rem;
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
  }

  .hero-clock .clock-icon { color: var(--text-muted); flex-shrink: 0; }
  .hero-clock .clock-label { color: var(--text-muted); font-weight: 400; }
  .hero-clock .clock-time { font-weight: 650; }
  .hero-clock .clock-tz {
    font-weight: 500; color: var(--sea);
    background: var(--sea-light); padding: 1px 6px; border-radius: 999px; letter-spacing: .03em;
  }
  .hero-clock .clock-date { color: var(--text-muted); font-weight: 400; }
  .hero-clock .clock-sep { color: var(--text-muted); opacity: .4; font-weight: 300; }

  /* ── Weather ── */
  .hero-weather {
    display: flex; align-items: center; gap: 5px;
    font-size: .85rem; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums;
    min-height: 3em; /* reserve space — real text wraps to 2 lines on mobile */
    line-height: 1;
  }
  .hero-weather .wx-icon {
    width: 2.2em; height: 2.2em; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .hero-weather .wx-temp { font-weight: 650; line-height: 1; }
  .hero-weather .wx-detail { color: var(--text-muted); font-weight: 400; line-height: 1; }
  .hero-weather .wx-sep { color: var(--text-muted); opacity: .35; font-weight: 300; margin: 0 1px; line-height: 1; }
  .hero-weather .wx-sea { color: var(--sea); font-weight: 550; line-height: 1; }
  .hero-weather .wx-wave { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: middle; }

  /* ── Sun path ── */
  .hero-sun { margin-top: 1.5rem; max-width: 520px; margin-inline: auto; min-height: 60px; }
  .hero-sun svg { width: 100%; height: auto; display: block; }

  /* ── Layout ── */
  .container { max-width: 960px; margin: 0 auto; padding: 0 1.25rem 3rem; }
  .grid { display: flex; flex-direction: column; gap: 1.5rem; }

  /* ── Intro ── */
  .intro { text-align: center; padding: 0 0.5rem 2rem; }
  .intro-title { font-size: 1.15rem; font-weight: 650; color: var(--text); margin-bottom: 0.75rem; letter-spacing: -0.01em; }
  .intro-body { max-width: 620px; margin: 0 auto; font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; }
  .intro-body p + p { margin-top: 0.7rem; }

  /* ── About ── */
  .about { padding: 2.5rem 0.5rem 1rem; text-align: center; }
  .about-title { font-size: 1.15rem; font-weight: 650; color: var(--text); margin-bottom: 0.75rem; letter-spacing: -0.01em; }
  .about-body { max-width: 620px; margin: 0 auto; font-size: 0.88rem; color: var(--text-muted); line-height: 1.75; }
  .about-body p + p { margin-top: 0.85rem; }

  /* ── Webcam Card ── */
  .cam-card {
    background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-md); transition: transform var(--transition), box-shadow var(--transition), opacity 0.4s ease;
    display: flex; flex-direction: column;
  }
  .cam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .cam-card.dead { opacity: .45; pointer-events: none; }
  .cam-card.dead .live-tag { color: #999; }
  .cam-card.dead .live-tag::before { background: #999; animation: none; }

  /* ── Video container ── */
  .cam-media {
    position: relative; aspect-ratio: 16 / 9; background: #1a1a1a; overflow: hidden; cursor: pointer;
  }
  .cam-media video, .cam-media .poster-img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  }
  .cam-media video { z-index: 1; background: #000; }
  .cam-media .poster-img { z-index: 2; }
  .cam-card.playing .cam-media .poster-img { opacity: 0; pointer-events: none; }

  /* ── Play button ── */
  .cam-media .play-overlay {
    position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
    transition: opacity 0.25s ease;
  }
  .cam-card.playing .cam-media .play-overlay { opacity: 0; pointer-events: none; }
  .cam-media .play-circle {
    width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.55);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease; box-shadow: 0 4px 24px rgba(0,0,0,.3);
  }
  .cam-media:hover .play-circle { transform: scale(1.08); background: rgba(0,0,0,.7); }
  .cam-media .play-circle svg { width: 24px; height: 24px; margin-left: 3px; }

  /* ── Loading badge ── */
  .cam-media .loading-badge {
    position: absolute; bottom: 12px; right: 12px; z-index: 5;
    background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; font-weight: 600;
    padding: 5px 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px;
    opacity: 0; transition: opacity .3s ease;
  }
  .cam-card.buffering .cam-media .loading-badge { opacity: 1; }
  .loading-badge .mini-spin {
    width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── Card info ── */
  .cam-info { padding: 1.15rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
  .cam-info .live-tag {
    display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; color: #d14242; margin-bottom: .3rem;
  }
  .cam-info .live-tag::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d14242;
    animation: pulse-dot 1.8s ease-in-out infinite;
  }
  .cam-info h3 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; color: var(--text); }
  .cam-info .location { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
  .cam-info .location svg { flex-shrink: 0; opacity: .55; }
  .cam-info .desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.5; }
  .cam-meta {
    margin-top: auto; padding-top: .9rem; display: flex; align-items: center;
    justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  }
  .cam-meta .source { font-size: .7rem; color: var(--text-muted); }
  .cam-meta .btn {
    font-size: .75rem; font-weight: 600; padding: 7px 15px; border-radius: 999px;
    text-decoration: none; transition: var(--transition); white-space: nowrap;
  }
  .btn-outline { color: var(--sea); border: 1.5px solid var(--sea); background: transparent; }
  .btn-outline:hover { background: var(--sea); color: #fff; }

  /* ── Footer ── */
  .footer { text-align: center; padding: 2rem 1.5rem; color: var(--text-muted); font-size: .75rem; opacity: .65; }
  .footer a { color: var(--text-muted); }

  /* ── Fullscreen controls ── */
  .cam-controls {
    position: absolute; bottom: 10px; right: 10px; z-index: 6;
    display: flex; gap: 4px; opacity: 0; transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease; pointer-events: none;
  }
  .cam-media:hover .cam-controls {
    opacity: 1; transform: translateY(0); pointer-events: auto;
  }
  .cam-controls button {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: none; border-radius: 8px;
    background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    color: #fff; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; padding: 0;
  }
  .cam-controls button:hover { background: rgba(0,0,0,.75); transform: scale(1.08); }
  .cam-controls button:active { transform: scale(.95); }
  .cam-controls button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* ── Config panel ── */
  .cfg-hint { font-size: .7rem; color: var(--text-muted); opacity: .55; cursor: pointer; margin: .6rem 0 0; transition: opacity .2s; }
  .cfg-hint:hover { opacity: .85; }

  .cfg-btn {
    display: block; margin: .35rem auto 0;
    width: 36px; height: 36px; border-radius: 8px; border: none;
    background: transparent; cursor: pointer; color: var(--text-muted);
    transition: color 0.2s ease, background 0.2s ease;
  }
  .cfg-btn:hover { color: var(--text); background: rgba(0,0,0,.05); }
  .cfg-btn svg { width: 18px; height: 18px; }

  .cfg-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000;
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
  }
  .cfg-backdrop.open { opacity: 1; pointer-events: auto; }

  .cfg-panel {
    position: fixed; top: 0; right: -320px; width: 300px; max-width: 90vw; height: 100vh;
    background: var(--card-bg); z-index: 1001; box-shadow: -4px 0 32px rgba(0,0,0,.15);
    padding: 1.5rem 1.3rem; overflow-y: auto;
    transition: right .3s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; gap: .35rem;
  }
  .cfg-panel.open { right: 0; }
  .cfg-panel h3 { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin-bottom: .75rem; }
  .cfg-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid rgba(0,0,0,.06); font-size: .82rem; color: var(--text); gap: .75rem; }
  .cfg-row label { flex: 1; cursor: pointer; user-select: none; }
  .cfg-toggle {
    appearance: none; width: 40px; height: 22px; border-radius: 11px; background: #ccc;
    cursor: pointer; transition: background .2s ease; position: relative; flex-shrink: 0;
  }
  .cfg-toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  }
  .cfg-toggle:checked { background: var(--sea); }
  .cfg-toggle:checked::after { transform: translateX(18px); }
  .cfg-reset {
    margin-top: 1rem; padding: .55rem 1rem; border: 1.5px solid #ccc; border-radius: 8px;
    background: transparent; color: var(--text-muted); font-size: .75rem; font-weight: 600;
    cursor: pointer; transition: all .2s ease; letter-spacing: .03em;
  }
  .cfg-reset:hover { border-color: var(--accent); color: var(--accent); }

  .cfg-order-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 1rem; margin-bottom: .3rem; }
  .cfg-order-row { display: flex; align-items: center; gap: 4px; padding: .25rem 0; border-bottom: 1px solid rgba(0,0,0,.05); font-size: .75rem; }
  .cfg-order-row span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cfg-order-btn { width: 26px; height: 26px; border: none; border-radius: 5px; background: transparent; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: background .15s; font-size: .85rem; }
  .cfg-order-btn:hover { background: rgba(0,0,0,.06); color: var(--text); }
  .cfg-order-btn:disabled { opacity: .25; pointer-events: none; }
  .cfg-order-btn svg { width: 14px; height: 14px; }
  .cfg-close {
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
    border: none; background: transparent; cursor: pointer; color: var(--text-muted);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: background .15s ease;
  }
  .cfg-close:hover { background: rgba(0,0,0,.06); }
  body.hide-cam-info .cam-info { display: none; }

  /* ── Language switcher ── */
  .lang-switcher { margin-top: .5rem; font-size: .7rem; letter-spacing: .04em; }
  .lang-switcher a { color: var(--text-muted); text-decoration: none; transition: color .15s ease; font-weight: 500; }
  .lang-switcher a:hover, .lang-switcher a.active { color: var(--text); font-weight: 700; }
  .lang-sep { color: var(--text-muted); opacity: .3; margin: 0 2px; }

  /* ── Responsive ── */
  @media (max-width: 768px) {
    .cam-controls button { width: 32px; height: 32px; }
    .cam-controls button svg { width: 16px; height: 16px; }
  }
  @media (max-width: 480px) {
    .cam-info { padding: 1rem 1.1rem; }
    .cam-info h3 { font-size: .95rem; }
    .hero h1 { font-size: 1.5rem; }
    .cam-media .play-circle { width: 52px; height: 52px; }
  }
