@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
  --ink: #171714;
  --muted: #77756e;
  --paper: #f3f0e9;
  --panel: #ebe7df;
  --line: #cbc6bb;
  --acid: #d7ff35;
  --white: #fff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23,23,20,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,23,20,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 40px 40px;
  font-family: "Noto Sans JP", sans-serif;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1180px, calc(100% - 48px)); margin: auto; }

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  font: 700 17px/1 "DM Mono", monospace;
  letter-spacing: .12em;
}

.brand-mark { width: 25px; height: 18px; border: 2px solid; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; inset: 3px auto 3px 4px; width: 2px; background: var(--ink); box-shadow: 5px 0 var(--ink), 10px 0 var(--ink); }

.privacy { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 12px; }
.privacy span { width: 7px; height: 7px; border-radius: 50%; background: #61a520; box-shadow: 0 0 0 4px rgba(97,165,32,.12); }

.hero { padding: 48px 0 32px; }
.eyebrow, .section-heading p {
  margin: 0 0 16px;
  font: 500 11px/1 "DM Mono", monospace;
  letter-spacing: .18em;
  color: var(--muted);
}
.hero h1 { margin: 0; max-width: 1050px; font-size: clamp(38px, 5.8vw, 72px); line-height: 1.12; letter-spacing: -.055em; font-weight: 600; }
.hero h1 em { font-style: normal; position: relative; z-index: 0; }
.hero h1 em::after { content: ""; position: absolute; z-index: -1; left: -.02em; right: -.04em; bottom: .08em; height: .22em; background: var(--acid); }
.intro { color: var(--muted); line-height: 1.8; margin: 18px 0 0; font-size: 14px; }

.upload-panel { margin-bottom: 56px; }
.drop-zone {
  width: 100%;
  min-height: 210px;
  border: 1px dashed #8f8b81;
  background: rgba(255,255,255,.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: .2s ease;
}
.drop-zone:hover, .drop-zone.dragover { background: var(--acid); border-color: var(--ink); transform: translateY(-2px); }
.drop-zone strong { font-size: 17px; }
.drop-zone > span:not(.upload-icon) { font-size: 13px; color: var(--muted); }
.drop-zone small { margin-top: 14px; color: #949187; font-size: 10px; }
.upload-icon { width: 49px; height: 49px; border: 1px solid; border-radius: 50%; display: grid; place-items: center; margin-bottom: 9px; }
.upload-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.workspace { margin: 0 0 48px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.section-heading > div { position: relative; padding-left: 47px; }
.section-heading p { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.step-number { position: absolute; left: 0; bottom: 2px; font: 500 11px/1 "DM Mono", monospace; border-bottom: 1px solid; padding-bottom: 5px; }
.text-button { border: 0; background: none; padding: 8px 0; font-size: 12px; border-bottom: 1px solid; }

.video-card { background: var(--ink); }
.video-card video { width: 100%; max-height: 610px; display: block; background: #090909; }
.file-meta { min-height: 54px; color: #aaa99f; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font: 400 11px/1 "DM Mono", monospace; }
.file-meta > span:last-child { display: flex; align-items: center; gap: 12px; }
.file-meta b { font-weight: 400; }
.file-meta i { width: 3px; height: 3px; border-radius: 50%; background: #777; }

.editor-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-top: 0; }
.time-section, .result-section { padding: 28px 32px; min-width: 0; }
.time-section { border-right: 1px solid var(--line); }
.section-heading.compact { margin-bottom: 26px; }
.section-heading.compact h2 { font-size: 18px; }

.timecode-label { display: block; font-size: 11px; margin-bottom: 9px; color: var(--muted); }
.timecode-wrap { display: flex; border-bottom: 2px solid var(--ink); }
.timecode-wrap input { width: 100%; min-width: 0; padding: 8px 0 11px; border: 0; background: transparent; outline: 0; font: 500 clamp(23px, 3vw, 35px)/1 "DM Mono", monospace; letter-spacing: -.04em; }
.timecode-wrap button { align-self: center; white-space: nowrap; background: transparent; border: 1px solid var(--line); padding: 7px 10px; font-size: 10px; }
.hint { margin: 7px 0 22px; color: #a09c92; font: 400 9px/1 "DM Mono", monospace; letter-spacing: .13em; }

.nudge-row { display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 24px; }
.nudge-row button { padding: 8px 2px; border: 1px solid var(--line); border-right: 0; background: transparent; font: 400 9px/1 "DM Mono", monospace; }
.nudge-row button:last-child { border-right: 1px solid var(--line); }
.nudge-row button:hover { background: var(--ink); color: var(--white); }

.timeline { width: 100%; accent-color: var(--ink); height: 3px; display: block; margin: 10px 0; }
.timeline-labels { display: flex; justify-content: space-between; color: #9a978e; font: 400 9px/1 "DM Mono", monospace; }
.capture-button, .download-button {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--acid);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-weight: 700;
  font-size: 13px;
  margin-top: 24px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: .15s;
}
.capture-button:hover, .download-button:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.capture-button:disabled { opacity: .5; cursor: wait; }
.capture-button svg, .download-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.status { min-height: 18px; margin: 12px 0 0; font-size: 11px; color: var(--muted); text-align: center; }
.status.error { color: #b33825; }

.preview-empty { min-height: 260px; border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #a3a097; text-align: center; font-size: 12px; line-height: 1.8; }
.preview-empty svg { width: 40px; fill: none; stroke: currentColor; stroke-width: 1; }
.preview-result canvas { width: 100%; max-height: 320px; object-fit: contain; background: #ddd8ce; display: block; }
.export-meta { display: flex; justify-content: space-between; padding: 12px 0; font: 400 10px/1 "DM Mono", monospace; color: var(--muted); }
.export-controls { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: end; margin-top: 8px; }
.export-controls label { font-size: 10px; color: var(--muted); }
.export-controls select { width: 100%; height: 45px; border: 1px solid var(--line); background: transparent; padding: 0 8px; margin-top: 7px; }
.download-button { min-height: 45px; margin: 0; }

.desc-content { margin: 52px 0; border-top: 1px solid var(--ink); padding-top: 40px; }
.desc-intro { max-width: 720px; }
.desc-intro h2, .faq h2 { margin: 0 0 14px; font-size: 25px; letter-spacing: -.04em; }
.desc-intro > p:last-child { color: var(--muted); font-size: 13px; line-height: 1.9; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; }
.info-grid article { background: var(--paper); padding: 25px; }
.info-grid article > span { font: 500 10px/1 "DM Mono", monospace; color: var(--muted); }
.info-grid h3 { margin: 18px 0 10px; font-size: 15px; }
.info-grid p, .faq p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.faq { margin-top: 38px; max-width: 820px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 17px 2px; cursor: pointer; font-size: 13px; font-weight: 600; }
.faq details p { padding: 0 2px 18px; }

footer { min-height: 70px; border-top: 1px solid var(--ink); display: flex; align-items: center; justify-content: flex-start; gap: 18px; color: var(--muted); font: 400 9px/1 "DM Mono", monospace; letter-spacing: .14em; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 28px, 600px); }
  .topbar { height: 68px; }
  .privacy { font-size: 9px; }
  .hero { padding: 38px 0 26px; }
  .hero h1 { font-size: clamp(34px, 10.5vw, 52px); }
  .intro { margin-left: 0; }
  .drop-zone { min-height: 190px; }
  .editor-grid { grid-template-columns: 1fr; }
  .time-section { border-right: 0; border-bottom: 1px solid var(--line); }
  .time-section, .result-section { padding: 24px 20px; }
  .file-meta { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .nudge-row { grid-template-columns: repeat(3, 1fr); row-gap: 6px; }
  .nudge-row button:nth-child(3) { border-right: 1px solid var(--line); }
  .desc-content { margin: 38px 0; padding-top: 30px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid article { padding: 21px; }
}
