/* Role tokens and type scale copied from src/styles.css (DESIGN.md「色」「文字」).
   Change them there first, then here. The one exception is --link, which is
   for this page only (the app has no links in text); it takes the --focus
   value and means nothing else here.
   The page's text is in the polite form (です/ます), unlike the app's plain
   form (DESIGN.md「文言」): it speaks to someone deciding whether to try it. */
:root {
  --surface-page: #f4f6f3;
  --surface-panel: #ffffff;
  --surface-sunken: #eef1ed;
  --text: #1b1f1c;
  --text-muted: #535a55;
  --border: #d5dad5;
  --border-strong: #8a948c;
  --action-primary: #1d4a34;
  --action-primary-text: #ffffff;
  --status-warn: #a85400;
  --focus: #2f5fb3;
  --link: #2f5fb3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-page: #121614;
    --surface-panel: #1c211e;
    --surface-sunken: #232a26;
    --text: #e9ece9;
    --text-muted: #adb5af;
    --border: #343c37;
    --border-strong: #66726a;
    --action-primary: #a3d65c;
    --action-primary-text: #0f2f26;
    --status-warn: #ffb547;
    --focus: #8fb3ff;
    --link: #8fb3ff;
  }
}

:root {
  --text-xs: 12px;
  --leading-xs: 1.4;
  --text-sm: 13px;
  --leading-sm: 1.5;
  --text-md: 15px;
  --leading-md: 1.6;
  --text-lg: 17px;
  --leading-lg: 1.4;
  --text-xl: 20px;
  --leading-xl: 1.3;
  --text-2xl: 28px;
  --leading-2xl: 1.2;
  --font-ui: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color-scheme: light dark;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-md);
  color: var(--text);
  background: var(--surface-page);
}

body {
  margin: 0;
  background: var(--surface-page);
}

/* hidden wins over the display set below (the 動画 link before a video). */
[hidden] {
  display: none !important;
}

a {
  color: var(--link);
}

/* The browser's monospace default is off the scale; keep it on --text-sm. */
code {
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  box-sizing: border-box;
  max-width: 992px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header: the name on the left, links to the sections on the right. */
.site-header {
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.site-nav a {
  display: inline-block;
  min-height: 24px;
  padding: 2px 0;
}

main {
  padding: 24px 0 32px;
}

section {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Break the question between phrases, not inside a word (<wbr> in the HTML
   for browsers without auto-phrase). */
h1 {
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-weight: 600;
  margin: 0 0 8px;
  word-break: auto-phrase;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: 600;
  margin: 0 0 8px;
}

h3 {
  font-size: var(--text-md);
  line-height: var(--leading-md);
  font-weight: 600;
  margin: 16px 0 4px;
}

p,
ul,
ol {
  margin: 0 0 8px;
}

ul,
ol {
  padding-left: 24px;
}

li + li {
  margin-top: 4px;
}

.hint {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-muted);
}

/* The opening block: what the app is, and the two ways in. */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 0;
}

.hero > img {
  width: 96px;
  height: 96px;
  flex: none;
}

.hero > div {
  flex: 1 1 320px;
}

.eyebrow {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  word-break: auto-phrase;
}

/* What a run tells you: the page's main promise, one line each. */
.gains {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: 600;
}

/* The short "what it does not do" next to the download; details are below. */
.assure {
  padding: 8px 12px;
  border-left: 4px solid var(--border-strong);
  background: var(--surface-sunken);
  border-radius: 4px;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.assure a {
  white-space: nowrap;
}

kbd {
  font-family: inherit;
  font-size: var(--text-sm);
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-sunken);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 16px 0 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.button.primary {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--action-primary-text);
}

/* The primary button keeps its own edge on hover, as in the app. */
.button:not(.primary):hover {
  border-color: var(--text);
}

/* Screens: one per row at the full width, so the app's text in a clip stays
   readable. Each sits on a sunken frame so its buttons do not read as the
   page's own. */
.screens {
  display: grid;
  gap: 32px;
  margin: 8px 0 0;
}

figure {
  margin: 0;
}

.point h3 {
  margin-top: 0;
}

/* A still links to its full size; a clip sits in the same frame. */
.shot {
  display: block;
  padding: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* The tutorial video: 16:9 once an ID is set (the section is hidden before). */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 8px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video .video-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.warn {
  padding: 8px 12px;
  border-left: 4px solid var(--status-warn);
  background: var(--surface-sunken);
  border-radius: 4px;
}

.site-footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-muted);
}

.site-footer .legal {
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
}

@media (max-width: 600px) {
  .site-nav {
    margin-left: 0;
  }

  section {
    padding: 12px;
  }

  .hero > img {
    width: 64px;
    height: 64px;
  }
}
