/* ═══════════════════════════════════════════════════════
   dewos.css — DewOS subpage
═══════════════════════════════════════════════════════ */

/* ── Page wrapper ──────────────────────────────────────── */
.dw { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ── Hero ──────────────────────────────────────────────── */
.dw-hero {
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 4rem;
  display: flex; flex-direction: column;
}
.dw-hero__meta {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--muted); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.dw-badge {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #f0ad3c; border: 1px solid rgba(240,173,60,0.3); padding: 3px 8px;
}
.dw-badge--cyan { color: var(--cyan); border-color: rgba(54,197,240,0.3); }
.dw-hero__title {
  font-family: var(--ff-disp);
  font-size: clamp(5rem, 20vw, 18rem);
  line-height: 0.85; letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
  animation: wordUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.dw-hero__sub {
  color: var(--muted); font-size: 12px; line-height: 1.85;
  max-width: 560px; margin-bottom: 2rem;
}
.dw-hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2.5rem; }

/* ── Buttons ───────────────────────────────────────────── */
.dw-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0 1.2rem; height: 44px;
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.06em; border: 1px solid var(--border-2);
  transition: background 150ms, border-color 150ms, color 150ms;
  touch-action: manipulation; white-space: nowrap;
}
.dw-btn--main { background: var(--cyan); color: #050505; border-color: transparent; font-weight: 600; }
.dw-btn--main:hover, .dw-btn--main:active { background: #5dd4f5; }
.dw-btn--ghost { color: var(--muted); }
.dw-btn--ghost:hover, .dw-btn--ghost:active { color: var(--text); border-color: var(--muted); }
.dw-btn--lg { height: 48px; padding: 0 1.5rem; font-size: 12px; }
.dw-btn__icon { font-size: 14px; }

/* ── Download block with canvas ────────────────────────── */
.dw-dl {
  border: 1px solid var(--border-2);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 1rem;
  opacity: 0; transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.dw-dl.visible { opacity: 1; transform: none; }

.dw-dl__screen {
  position: relative;
  width: 100%;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.dw-dl__canvas { display: block; width: 100%; height: auto; }

/* Replay button overlay */
.dw-dl__replay {
  position: absolute; bottom: 0.7rem; right: 0.8rem;
  font-family: var(--ff-mono); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border-2);
  padding: 3px 8px; background: rgba(8,8,8,0.8);
  cursor: pointer; transition: color 130ms, border-color 130ms;
  touch-action: manipulation;
}
.dw-dl__replay:hover { color: var(--text); border-color: var(--muted); }

.dw-dl__info { padding: 1.2rem 1.4rem; }
.dw-dl__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.dw-dl__name { display: flex; align-items: center; gap: 0.7rem; font-size: 13px; font-weight: 500; margin-bottom: 0.6rem; }
.dw-dl__desc { color: var(--muted); font-size: 11.5px; line-height: 1.8; max-width: 500px; margin-bottom: 0.8rem; }
.dw-dl__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dw-dl__meta span {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border-2); padding: 3px 7px;
}

/* ── Terminal ──────────────────────────────────────────── */
.dw-terminal {
  border: 1px solid var(--border-2);
  background: var(--surface);
  overflow: hidden;
  max-width: 100%;
}
.dw-terminal--tall .dw-terminal__body { min-height: 260px; }
.dw-terminal__bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}
.dw-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dw-terminal__title { font-size: 10px; letter-spacing: 0.06em; color: var(--muted); margin-left: 0.5rem; }
.dw-terminal__body {
  padding: 1rem 1.1rem;
  min-height: 200px;
  font-size: 11.5px; line-height: 1.85;
  color: #b8b8b8; white-space: pre; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dw-terminal__body--interactive { min-height: 220px; }
.dw-terminal__input-row {
  display: flex; align-items: center;
  padding: 0.5rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 11.5px; line-height: 1;
  min-height: 36px;
}
.dw-prompt { color: #36c5f0; font-weight: 600; white-space: nowrap; }
.dw-cursor { color: var(--text); margin-left: 1px; }
.dw-terminal.focused { border-color: var(--border-2); outline: 1px solid rgba(54,197,240,0.3); }

/* ── Section scaffold ──────────────────────────────────── */
.dw-section {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 3rem; padding: 3.5rem 0 var(--sec-pad);
}
.dw-section__num { font-size: 9px; letter-spacing: 0.22em; color: var(--dim); padding-top: 0.6rem; }
.dw-section__body h2 {
  font-family: var(--ff-disp);
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 0.9; letter-spacing: 0.01em; margin-bottom: 2.5rem;
}
.dw-text { color: var(--muted); font-size: 12px; line-height: 1.85; margin-bottom: 1.2rem; }
.dw-text a { color: var(--cyan); border-bottom: 1px solid rgba(54,197,240,0.3); transition: border-color 130ms; }
.dw-text a:hover { border-color: var(--cyan); }

/* ── Grid ──────────────────────────────────────────────── */
.dw-grid2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.dw-card {
  background: var(--bg); padding: 1.4rem;
  opacity: 0; transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.dw-card.visible { opacity: 1; transform: none; }
.dw-card h3 { font-family: var(--ff-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 0.7rem; color: var(--text); }
.dw-card p { color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.dw-card--dim h3 { color: var(--muted); }
.dw-card--dim p { color: var(--dim); }
.dw-card code { font-family: var(--ff-mono); font-size: 10px; color: var(--cyan); background: rgba(54,197,240,0.07); padding: 1px 4px; }
.c-green { color: #4ade80; }
.c-red { color: #f87171; }

/* ── Two col ───────────────────────────────────────────── */
.dw-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

/* ── Code block ────────────────────────────────────────── */
.dw-code {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1rem 1.2rem; font-family: var(--ff-mono);
  font-size: 11px; line-height: 1.82; color: #b0b0b0;
  overflow-x: auto; white-space: pre; margin-bottom: 1.2rem;
  -webkit-overflow-scrolling: touch;
}
.dw-code--sm { font-size: 10.5px; }
.dw-code .c-dim, .dw-code code .c-dim { color: var(--muted); }
.dw-code .c-cyan { color: var(--cyan); }

/* ── Warning ───────────────────────────────────────────── */
.dw-warning {
  display: flex; gap: 1rem; align-items: flex-start;
  border: 1px solid rgba(240,173,60,0.2);
  background: rgba(240,173,60,0.04);
  padding: 1rem 1.1rem; margin-top: 1rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.dw-warning.visible { opacity: 1; transform: none; }
.dw-warning--sm { margin-top: 0.8rem; }
.dw-warning__icon { color: #f0ad3c; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.dw-warning p { color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.dw-warning p a { color: var(--cyan); border-bottom: 1px solid rgba(54,197,240,0.3); }
.dw-warning p strong { color: var(--text); }

/* ── Steps ─────────────────────────────────────────────── */
.dw-step {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 2rem; border-top: 1px solid var(--border); padding: 2.2rem 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity 450ms ease, transform 450ms ease;
}
.dw-step:last-child { border-bottom: 1px solid var(--border); }
.dw-step.visible { opacity: 1; transform: none; }
.dw-step__num { font-family: var(--ff-disp); font-size: 3rem; line-height: 1; color: var(--dim); padding-top: 0.2rem; }
.dw-step__content h3 { font-family: var(--ff-disp); font-size: 2rem; letter-spacing: 0.02em; line-height: 1; margin-bottom: 1rem; }

/* ── Tabs ──────────────────────────────────────────────── */
.dw-tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dw-tab {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted); padding: 0.55rem 1rem; border: 1px solid transparent;
  border-bottom: none; transition: color 130ms, background 130ms;
  position: relative; bottom: -1px; white-space: nowrap;
  min-height: 36px; touch-action: manipulation;
}
.dw-tab:hover { color: var(--text); }
.dw-tab.active { color: var(--text); background: var(--bg); border-color: var(--border); border-bottom-color: var(--bg); }
.dw-tab-panel { display: none; padding-top: 1rem; }
.dw-tab-panel.active { display: block; }
.dw-tip { margin-top: 0.8rem; font-size: 11px; color: var(--muted); border-left: 2px solid var(--border-2); padding-left: 0.8rem; line-height: 1.75; }
.dw-tip strong { color: var(--text); }
.dw-tip code { font-family: var(--ff-mono); font-size: 10px; color: var(--cyan); }

/* ── Hint ──────────────────────────────────────────────── */
.dw-hint { margin-top: 0.7rem; font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.dw-hint code { color: var(--cyan); background: rgba(54,197,240,0.07); padding: 1px 4px; font-size: 10px; }

/* ── Footer ────────────────────────────────────────────── */
.dw-footer { padding: 3rem 0 calc(var(--sec-pad) * 1.4); }
.dw-footer__back { margin-top: 1.5rem; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.dw-footer__back a:hover { color: var(--text); }

/* ── Inline code ───────────────────────────────────────── */
code { font-family: var(--ff-mono); font-size: 0.92em; color: var(--cyan); background: rgba(54,197,240,0.07); padding: 1px 4px; }
pre code { color: inherit; background: none; padding: 0; font-size: inherit; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dw-grid2 { grid-template-columns: 1fr; }
  .dw-two-col { grid-template-columns: 1fr; }
  .dw-dl__row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .dw-section { grid-template-columns: 1fr; gap: 1rem; padding: 2.5rem 0 var(--sec-pad); }
  .dw-section__num { display: none; }
  .dw-section__body h2 { font-size: clamp(2.4rem, 12vw, 4rem); margin-bottom: 1.5rem; }
  .dw-step { grid-template-columns: 1fr; gap: 0.5rem; }
  .dw-step__num { font-size: 1.5rem; }
  .dw-hero__title { font-size: clamp(4.5rem, 20vw, 8rem); }
  .dw-hero { padding-top: calc(var(--nav-h) + 2.5rem); }
  .dw-terminal__body { font-size: 10.5px; min-height: 160px; }
  .dw-card { padding: 1rem; }
  .dw-code { font-size: 10px; padding: 0.8rem 0.9rem; }
}

@media (max-width: 430px) {
  .dw-hero__title { font-size: clamp(4rem, 18vw, 6rem); }
  .dw-hero__actions { flex-direction: column; }
  .dw-hero__actions .dw-btn { width: 100%; justify-content: center; }
  .dw-terminal__body { font-size: 9.5px; }
  .dw-step__content h3 { font-size: 1.6rem; }
}

@media (max-width: 390px) {
  .dw-hero__title { font-size: clamp(3.5rem, 17vw, 5rem); }
}
