:root {
  --paper: #FFFFFF;
  --panel: #F6F7F8;
  --ink: #16181C;
  --line: #E1E4E8;
  --mute: #767C87;
  --gray-700: #2B3038;
  --gray-600: #3C424B;
  --gray-500: #545B66;
  --rec: #D64545;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-700);
}

.brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
}

/* ---------- Hamburger menu toggle ---------- */
.menu-toggle {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4.5px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle:hover { border-color: var(--gray-500); }
.menu-toggle:focus-visible { outline: 2px solid var(--gray-700); outline-offset: 2px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.site-menu {
  background: var(--paper);
  border-left: 1px solid var(--line);
  padding: 20px;
}

.site-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.site-menu-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.menu-close {
  background: none;
  border: none;
  color: var(--mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.menu-close:hover { color: var(--ink); }
.menu-close:focus-visible { outline: 2px solid var(--gray-700); outline-offset: 2px; }

.site-menu-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.site-menu-link:hover { color: var(--gray-700); }

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0 24px;
  min-height: 0;
}

.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.sub {
  color: var(--mute);
  font-size: 16px;
  margin: 0 0 36px;
  max-width: 42ch;
}

/* ---------- Upload frame — plain, no card shadow/fill ---------- */
.frame {
  position: relative;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  padding: 48px 24px;
  transition: border-color 0.2s ease;
}

.frame:focus-visible,
.frame.is-dragover {
  outline: none;
  border-color: var(--gray-600);
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  transition: border-color 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.frame.is-dragover .corner,
.frame:focus-visible .corner { border-color: var(--gray-600); width: 22px; height: 22px; }

.corner-tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corner-tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.corner-bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.corner-br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

#uploadForm {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#dropzone {
  flex: 1;
  width: 100%;
  max-width: 640px;
  min-height: 340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dz-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mute);
}

.status-dot--rec {
  background: var(--rec);
}

.dz-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 2px;
}

.dz-sub {
  font-size: 13px;
  color: var(--mute);
  margin: 4px 0;
}

.dz-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  margin: 14px 0 0;
}

.dz-filename {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 18px;
  word-break: break-all;
}

/* ---------- Buttons: flat, dark gray ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--gray-700); outline-offset: 2px; }

.btn-primary {
  background: var(--gray-700);
  color: #FFFFFF;
}
.btn-primary:hover { background: var(--gray-600); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--gray-500); }

/* ---------- Progress meter ---------- */
.meter {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--panel);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--gray-700);
  transition: width 0.15s ease;
}

/* ---------- Steps caption ---------- */
.steps {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.03em;
  text-align: center;
  margin: 32px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- Watch page ---------- */
.watch-main {
  flex: 1;
  padding-top: clamp(16px, 4vh, 40px);
}

.frame-video {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.frame-video video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
}

.frame-empty {
  text-align: center;
  padding: 64px 24px;
}
.empty-title { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 6px; }
.empty-sub { color: var(--mute); margin: 0; font-size: 14px; }

.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.share-url {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  margin-top: 14px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 28px 0 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  text-align: center;
}

/* ---------- Articles & static pages ---------- */
.content-main {
  flex: 1;
  padding-top: clamp(16px, 4vh, 36px);
  padding-bottom: 40px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 5vw, 30px);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

/* ---------- Article list: plain rows, no card fill/border-left ---------- */
.article-cards {
  display: flex;
  flex-direction: column;
}

.article-card {
  position: relative;
  display: block;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 22px 2px;
  text-decoration: none;
}

.article-cards .article-card:first-child { border-top: 1px solid var(--line); }

.article-card-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 10px;
}

.article-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
}

.article-card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--mute);
  margin: 0 0 14px;
}

.article-card-readmore {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
}
.article-card:hover .article-card-readmore { color: var(--ink); }

/* ---------- Article detail typography ---------- */
.article-body h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.article-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin: 0 0 28px;
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--ink); }

.empty-note {
  color: var(--mute);
  font-size: 14px;
}

.terms-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}
.terms-body h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 32px 0 10px;
}
.terms-body h2:first-child { margin-top: 0; }
.terms-body p { margin: 0 0 14px; color: var(--mute); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

@media (max-width: 520px) {
  .topbar { padding: 16px 0; }
  .frame { padding: 28px 16px; }
  #dropzone { min-height: 300px; }
  .share-row { flex-direction: column; align-items: stretch; }
  .share-url { white-space: normal; word-break: break-all; }
}

/* ---------- Support-ad overlay (inside video frame) — flat ---------- */
.ad-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22,24,28,0.72);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ad-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ad-card {
  position: relative;
  z-index: 21;
  width: min(360px, 88%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px 22px 22px;
  text-align: center;
}

.ad-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--mute);
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  z-index: 22;
}
.ad-card-close:hover { color: var(--ink); background: var(--panel); }
.ad-card-close:focus-visible { outline: 2px solid var(--gray-700); outline-offset: 2px; }

.ad-card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px;
  margin: 0 0 14px;
}

.ad-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 8px;
}

.ad-card-sub {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.5;
  margin: 0 0 20px;
}

.ad-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-card-skip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 22;
  position: relative;
}
.ad-card-skip:hover { color: var(--ink); }

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}

.article-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 10px;
}
.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
