/* =========================================================
   DESIGN TOKENS
========================================================= */
:root {
  --bg: #2c3440; --surface: #364050; --surface-2: #3d4858;
  --ink: #e8e4dc; --ink-muted: #9aaa9e;
  --teal: #02D0CD; --teal-dark: #01b0ae;
  --border: rgba(255,255,255,0.09);
  --radius: 5px; --radius-card: 16px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

body.light {
  --bg: #f2f0ec; --surface: #e8e4dd; --surface-2: #e8e4dc;
  --ink: #1a1a18; --ink-muted: #5a5a55;
  --teal: #019997; --teal-dark: #017a78;
  --border: #d4cfc6;
}


/* =========================================================
   RESET & BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body  { font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; }
a     { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
img   { display: block; max-width: 100%; }


/* =========================================================
   LAYOUT UTILITY
========================================================= */
.container { max-width: 1100px; margin-inline: auto; padding-inline: 20px; }


/* =========================================================
   HERO / SITE HEADER
========================================================= */
.site-hero           { background: var(--bg); padding-block: 20px 16px; border-bottom: 1px solid var(--border); }
.hero-row            { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-hero h1        { font-family: var(--font-head); font-size: clamp(24px,4vw,38px); font-weight: 400; line-height: 1.1; }
.subtitle            { color: var(--teal); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; margin-top: 4px; }
.hero-actions        { display: flex; align-items: center; gap: 10px; }
.hero-logo img       { width: 110px; height: 64px; border-radius: 4px; opacity: 0.85; transition: opacity var(--transition); }
.hero-logo img:hover { opacity: 1; }


/* =========================================================
   PROJECT NAV TABS
========================================================= */
.project-tabs            { background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.project-tabs .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 3px; }
.label                   { font-size: 11px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; }
.tabs-list               { list-style: none; display: flex; gap: 2px; flex-wrap: wrap; padding: 0; margin: 0; }
.tabs-list li            { position: relative; }
.tabs-list a             { display: inline-block; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--ink-muted); border-bottom: 2px solid transparent; transition: color var(--transition), border-color var(--transition); }
.tabs-list a:hover       { color: var(--ink); border-color: var(--teal); }
.tabs-list li.current a  { color: var(--ink); font-weight: 400; border-bottom: 2px solid var(--teal); }
.tabs-list a.active      { color: #0077cc; font-weight: 600; border-bottom: 2px solid #0077cc; }


/* =========================================================
   THEME TOGGLE BUTTON
========================================================= */
.theme-toggle       { display: flex; align-items: center; gap: 5px; padding: 3px 12px; background: none; border: 1px solid var(--border); border-radius: 20px; color: var(--ink-muted); font-family: var(--font-body); font-size: 11px; font-weight: 500; cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition); }
.theme-toggle:hover { background: var(--teal); color: #fff; border-color: var(--teal); }


/* =========================================================
   NAV — SUBMENU
========================================================= */
.arrow                       { font-size: 0.7em; margin-left: 4px; }
.submenu                     { list-style: none; position: absolute; top: 110%; left: 0; background: white; padding: 6px 0; margin: 0; min-width: 160px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.15); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: all 0.25s ease; }
.submenu li a                { padding: 8px 14px; }
.submenu li a:hover          { background: #f3f3f3; }
.has-submenu:hover .submenu  { opacity: 1; transform: translateY(0); pointer-events: auto; }
.submenu a.active            { background: #f0f6ff; }
.submenu a {
    color: black !important;
}

/* =========================================================
   BANNER
========================================================= */
.banner        { width: 100%; max-width: 1100px; max-height: 100px; margin: 5px auto 10px; display: block; box-shadow: var(--shadow-card); border-radius: var(--radius-card); overflow: hidden; position: relative; }
.banner img    { width: 100%; height: 200px; object-fit: cover; object-position: center 60%; }
.banner::after { content: ''; position: absolute; inset: 0; top: 5px; transition: background 0.3s; }

.banner-title    { position: absolute; top: 25%; left: 50%; transform: translate(-50%, -50%); color: #f1ede6; font-size: 2.2rem; font-weight: 700; z-index: 2; text-shadow: 0 4px 12px rgba(0,0,0,0.8); white-space: nowrap; }
.banner-subtitle { position: absolute; top: 70%; left: 50%; transform: translate(-50%, -50%); color: #f1ede6; font-size: 1.2rem; font-weight: 700; z-index: 2; text-shadow: 0 4px 12px rgba(0,0,0,0.8); white-space: nowrap; }


/* =========================================================
   GALLERY GRID
========================================================= */
main    { max-width: 1400px; margin: 0 auto; padding: 0 20px 2rem; }
.gallery { column-count: 1; column-gap: 1rem; }

@media (min-width: 600px)  { .gallery { column-count: 3; } }
@media (min-width: 1024px) { .gallery { column-count: 4; } }


/* =========================================================
   CARD
========================================================= */
.card          { display: inline-block; width: 100%; margin-bottom: 16px; break-inside: avoid; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); cursor: pointer; transition: transform 0.3s ease; }
.card:hover    { transform: scale(1.02); }
.card-image    { width: 100%; height: auto; }
.card-content  { padding: 1rem; }
.card-title    { font-size: 1.2rem; font-weight: 600; }
.card-subtitle { font-size: 0.9rem; color: #555; margin-top: 0.5rem; }


/* =========================================================
   MODAL
========================================================= */
.modal         { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 1000; }
.modal-content { position: relative; width: 95%; height: 95%; margin: 2.5% auto; background: #000; border-radius: 20px; overflow: hidden; }
.close-btn     { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; font-size: 24px; cursor: pointer; z-index: 1001; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.close-btn:hover { background: rgba(255,255,255,0.25); }
#viewer        { width: 100%; height: 100%; }


/* =========================================================
   ABOUT OVERLAY
========================================================= */
.about-overlay       { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 10001; backdrop-filter: blur(5px); }
.about-content       { position: relative; width: 90%; max-width: 700px; max-height: 80vh; margin: 5vh auto; background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); border-radius: 20px; padding: 3rem; box-shadow: 0 20px 60px rgba(0,0,0,0.5); overflow-y: auto; }
.about-close-btn     { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.2); color: #333; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.3s, transform 0.3s; }
.about-close-btn:hover { background: rgba(0,0,0,0.2); transform: rotate(90deg); }


/* =========================================================
   TOOLTIP
========================================================= */
.tooltip              { position: relative; }
.tooltiptext          { visibility: hidden; opacity: 0; position: absolute; bottom: -40px; left: 0; background: rgba(0,0,0,0.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; transition: opacity 0.25s; }
.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }


/* =========================================================
   FOOTER
========================================================= */
footer           { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; font-size: 12px; }
footer .container { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 12px; }
footer .f-left   { color: var(--ink-muted); }
footer .f-center { text-align: center; color: var(--ink-muted); }
footer .f-right  { text-align: right; }
footer a         { color: var(--ink-muted); }
footer a:hover   { color: var(--teal); }

@media (max-width: 768px) {
  footer .container { grid-template-columns: 1fr; text-align: center; }
  footer .f-left, footer .f-right { text-align: center; }
}

/* =========================================================
        ── MAIN ──
========================================================= */

    main { padding: 32px 0 64px; }

    .section { margin-bottom: 28px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
    .section-header { padding: 10px 18px; background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
    .section-header h2 { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; }
    .section-header .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); animation: pulse 2s ease-in-out infinite; }
    @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
    .section-body { padding: 0; }

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

    .video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
    .video-wrapper video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }

    .history-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
    .prev-day-item { background: var(--bg); }
    .prev-day-label { font-family: 'Syne', sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); padding: 8px 10px; border-bottom: 1px solid var(--border); }
    .prev-day-item .video-wrapper { padding-bottom: 56.25%; }

    .lot-img { width: 100%; height: auto; display: block; }
    .lot-caption { padding: 10px 18px 14px; font-size: 12px; color: var(--text-dim); line-height: 1.5; background: var(--bg); border-top: 1px solid var(--border); }

    .gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; background: var(--bg); }
    .gallery-grid a { display: block; border: 1px solid var(--accent); border-radius: 4px; overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
    .gallery-grid a:hover { border-color: var(--accent2); box-shadow: 0 0 0 2px var(--accent2), 0 0 28px rgba(239, 130, 46, 0.5); transform: translateY(-3px); }
    .gallery-grid img { width: 100%; height: auto; display: block; }

    footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; }
    footer .container { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 12px; }
    footer .f-left { color: var(--text-dim); }
    footer .f-center { text-align: center; color: var(--text-dim); }
    footer .f-right { text-align: right; }
    footer a { color: var(--text-dim); font-size: 12px; }
    footer a:hover { color: var(--accent); }

    /* ── RESPONSIVE ── */
    @media (max-width: 768px) {
      .meta-bar .container { grid-template-columns: 1fr; gap: 12px; }
      .meta-clock { text-align: left; }
      .gallery-grid { grid-template-columns: 1fr; }
      footer .container { grid-template-columns: 1fr; text-align: center; }
      footer .f-right { text-align: center; }
      footer .f-left { text-align: center; }
    }
    @media (max-width: 540px) {
      .history-grid { grid-template-columns: 1fr; }
    }
