/* "hidden" must always win over display rules (.gate is display:grid, .btn inline-flex) */
[hidden] { display: none !important; }

  :root {
    --bg: #f5f3ec; --panel: #fffdf7; --text: #1f2a1f; --muted: #5f6b5c; --line: #e2ded0;
    --accent: #3d7a3a; --accent-ink: #ffffff; --soft: #e7efdf; --warn: #a3520f; --warn-soft: #fbeadb;
    --shadow: 0 1px 2px rgba(30,40,25,.06), 0 6px 20px rgba(30,40,25,.06);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #121612; --panel: #1a201a; --text: #ecf0e6; --muted: #a2ad9d; --line: #2b332a;
      --accent: #7fbf6f; --accent-ink: #0f1a0d; --soft: #233023; --warn: #f0a868; --warn-soft: #3a2a1b;
      --shadow: none;
    }
  }
  :root[data-theme="dark"] {
    --bg: #121612; --panel: #1a201a; --text: #ecf0e6; --muted: #a2ad9d; --line: #2b332a;
    --accent: #7fbf6f; --accent-ink: #0f1a0d; --soft: #233023; --warn: #f0a868; --warn-soft: #3a2a1b;
    --shadow: none;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  a { color: var(--accent); }
  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
  h1, h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
  h2 { font-size: 26px; margin: 0 0 4px; }
  .sub { color: var(--muted); margin: 0 0 20px; }
  section { padding: 40px 0; }

  /* nav */
  nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
  .brand { display: flex; align-items: center; gap: 8px; font-family: Fraunces, Georgia, serif; font-size: 20px; text-decoration: none; color: var(--text); }
  .links { display: flex; gap: 18px; margin-left: auto; }
  .links a { color: var(--muted); text-decoration: none; font-size: 15px; }
  .links a:hover { color: var(--text); }
  @media (max-width: 560px) { .links { gap: 12px; } .links a { font-size: 14px; } .links .opt { display: none; } }

  /* hero */
  .hero { padding-top: 36px; padding-bottom: 8px; }
  .hero h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 8px; line-height: 1.1; }
  .hero p { color: var(--muted); max-width: 620px; margin: 0; font-size: 17px; }
  .top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 24px; }
  @media (max-width: 880px) { .top { grid-template-columns: 1fr; } }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }

  /* live camera */
  .cam { overflow: hidden; }
  .cam-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .cam-head strong { font-weight: 600; }
  .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
  .pill.live { background: #c62828; color: #fff; }
  .pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
  @keyframes blink { 50% { opacity: .3; } }
  .cam-head .spacer { flex: 1; }
  .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
  .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 6px 12px; font-size: 14px; font-weight: 500; }
  .btn:disabled { opacity: .6; cursor: default; }
  .frame { position: relative; width: 100%; aspect-ratio: 2176 / 1616; overflow: hidden; background: #0d120d; }
  .frame video { position: absolute; left: 0; top: 0; display: block; }
  .gate { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #eef3e8; padding: 20px;
          background: radial-gradient(ellipse at center, rgba(20,30,18,.55), rgba(10,14,9,.9)), url("/poster.jpg") center/cover; }
  .gate p { margin: 10px 0 0; font-size: 14px; color: #c7d2c0; max-width: 360px; }
  .gate .play { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; padding: 14px 24px; border-radius: 99px; }
  .cam-note { padding: 10px 16px; font-size: 13px; color: var(--muted); }

  /* weather */
  #weather { display: flex; flex-direction: column; }
  .wx { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
  .sensors { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
  .sec-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .sec-h .age { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .dot.stale { background: var(--muted); }
  .sens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sens .stat b { font-size: 20px; }
  .spark { width: 100%; height: 44px; display: block; }
  .legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
  .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
  .wx-now { display: flex; align-items: center; gap: 14px; }
  .wx-icon { font-size: 46px; line-height: 1; }
  .wx-temp { font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
  .wx-desc { color: var(--muted); font-size: 14px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
  .stat b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
  .stat span { font-size: 12px; color: var(--muted); }
  .alert { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 500; }
  .tip { background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
  .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
  .day { font-size: 12px; color: var(--muted); padding: 6px 0; border-radius: 8px; }
  .day .i { font-size: 20px; display: block; margin: 2px 0; }
  .day b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
  .wx-foot { font-size: 12px; color: var(--muted); }

  /* projects */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .proj { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
  .proj h3 { margin: 0; font-size: 18px; }
  .proj p { margin: 0; color: var(--muted); font-size: 15px; }
  .proj .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
  .status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--accent); }
  .status.planned { color: var(--muted); }
  .proj .more { margin-top: auto; font-weight: 600; color: var(--accent); text-decoration: none; }
  .proj .more:hover { text-decoration: underline; }
  .status.rebuilding, .status.paused { background: var(--warn-soft); color: var(--warn); }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tags span { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; color: var(--muted); }
  .next { font-size: 14px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: auto; }
  .next b { font-weight: 600; }

  /* contact */
  .contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
  @media (max-width: 800px) { .contact { grid-template-columns: 1fr; } }
  form { padding: 20px; display: grid; gap: 14px; }
  .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
  label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
  input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
  input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  textarea { min-height: 130px; resize: vertical; }
  .hp { position: absolute; left: -9999px; }
  .form-msg { font-size: 14px; min-height: 20px; }
  .form-msg.ok { color: var(--accent); } .form-msg.err { color: var(--warn); }
  footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
  .skel { color: var(--muted); font-size: 14px; }

/* ---------- videos, share, contact CTA, footer socials ---------- */
.sec-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-row .sub { margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.yt-btn { background: #c4302b; color: #fff; }
.yt-btn svg, .socials svg { width: 18px; height: 18px; fill: currentColor; }
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.vid { all: unset; cursor: pointer; display: grid; gap: 6px; }
.vid .thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #0d120d center / cover no-repeat; }
.vid .play { width: 54px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(196,48,43,.92); color: #fff; font-size: 18px; }
.vid .vt { font-weight: 600; font-size: 15px; }
.vid .vd { color: var(--muted); font-size: 13px; }
.yt-empty { display: block; padding: 18px; color: var(--text); text-decoration: none; }
.share-sec { padding-top: 0; }
.share-card, .cta { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.share-card .sub, .cta .sub { margin: 0; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; cursor: pointer; }
.sh:hover { border-color: var(--accent); color: var(--accent); }
.sh.native { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.socials { display: flex; gap: 16px; }
.socials a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.socials a:hover { color: var(--text); }
.page { padding-top: 32px; min-height: 70vh; }
.page-h { font-size: clamp(30px, 5vw, 40px); margin: 0 0 6px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.qa { padding: 14px 18px; }
.qa summary { cursor: pointer; font-weight: 600; }
.qa p { margin: 10px 0 0; color: var(--muted); }

.batt { font-variant-numeric: tabular-nums; margin-right: 6px; }
.batt.low { color: var(--warn); font-weight: 600; }

/* daily timelapse */
.tl { overflow: hidden; }
.tl video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0d120d; cursor: pointer; }
.tl-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.tl-bar .btn { min-width: 40px; padding-left: 10px; padding-right: 10px; }
.tl-bar input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.tl-clock { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; text-align: right; }
.tl-days { display: flex; align-items: center; gap: 6px; }
#tlDay { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
