@font-face {
  font-family: 'PttFlex';
  src: url('./ptt-flex.woff2') format('woff2-variations'),
       url('./ptt-flex.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

:root {
  --bg-page: #1a1a1a;
  --bg-card: #242424;
  --bg-screen: #000000;
  --fg: #e0e0e0;
  --fg-muted: #888;
  --accent: #ffb000;
  --link: #69b6ff;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'PttFlex', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}

header, footer, .controls {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  padding-top: 48px;
  padding-bottom: 24px;
}

header h1 {
  font-family: 'PttFlex', ui-monospace, monospace;
  font-variation-settings: 'wdth' 100;
  font-size: clamp(48px, 12vw, 96px);
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--fg);
}

.meta {
  font-size: 14px;
  margin: 0;
  color: var(--fg-muted);
}

.controls {
  padding-top: 24px;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.control-row label {
  font-size: 14px;
  color: var(--fg-muted);
  min-width: 80px;
}

.control-row input[type=range] {
  flex: 1;
  min-width: 200px;
  accent-color: var(--accent);
}

.control-row output {
  font-family: 'PttFlex', ui-monospace, monospace;
  font-variation-settings: 'wdth' 100;
  min-width: 36px;
  text-align: right;
  color: var(--accent);
  font-size: 14px;
}

.auto-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: auto;
}

.auto-label input { accent-color: var(--accent); }

.hint {
  font-size: 12px;
  color: var(--fg-muted);
}

/* The resizable frame around the screen. resize: horizontal lets the user
   drag the bottom-right corner; ResizeObserver re-fits wdth on every change. */
.screen-frame {
  margin: 16px auto 32px;
  max-width: calc(100% - 48px);
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid #333;
  resize: horizontal;
  overflow: auto;
  width: 100%;
  min-width: 240px;
}

@media (min-width: 768px) {
  .screen-frame {
    max-width: 900px;
  }
}

.screen {
  font-family: 'PttFlex', ui-monospace, SFMono-Regular, monospace;
  font-size: 16px;
  line-height: 1.18;
  font-variation-settings: 'wdth' var(--wdth, 100);
  background: var(--bg-screen);
  color: #c5c5c5;
  padding: 12px 14px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.row {
  display: block;
  white-space: pre;
  font-feature-settings: 'kern' 0;
  letter-spacing: 0;
}

.cell {
  display: inline;
}

footer {
  padding-top: 32px;
  padding-bottom: 64px;
  font-size: 13px;
  color: var(--fg-muted);
}

footer .why {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.85;
}
