/* TeLoAfilo · app. Taller de noche: fondo café casi negro, acento beige de la marca, piedra verde agua. */
:root {
  --ground: #1d1a16;
  --surface: #29251f;
  --surface-2: #332e27;
  --line: #4a4338;
  --ink: #f2ede3;
  --ink-2: #b8ae9c;
  --ink-3: #8a8171;
  --beige: #b5a98f;
  --steel: #cfd4d8;
  --steel-2: #8e979e;
  --stone: #3b5850;
  --stone-2: #2f4841;
  --brass: #c9a865;
  --nickel: #aeb0ab;
  --warn: #e3a857;
  --focus: #e9dcbf;
  --display: "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabh: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
a { color: var(--beige); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- barra superior y pestañas */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--ground); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; height: 52px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; letter-spacing: .06em; }
.brand img { width: 32px; height: 32px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabh); text-decoration: none; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--beige); }
@media (min-width: 860px) {
  .appbar { display: flex; align-items: center; justify-content: space-between; }
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; }
  .tabs a { flex-direction: row; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; gap: 8px; }
  .tabs svg { width: 18px; height: 18px; }
  .tabs a[aria-current="page"] { background: var(--surface-2); }
}

main { max-width: 1080px; margin: 0 auto; padding-block: 20px calc(var(--tabh) + 32px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 860px) { main { padding-bottom: 48px; } }
.view { display: flex; flex-direction: column; gap: 20px; }

/* ---------- tipografía */
.eyebrow, .glabel, .card-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; margin: 6px 0 0; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0; text-wrap: balance; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 46ch; margin: 10px 0 0; }
.hero { padding-block: 8px 4px; }
.pagehead { padding-top: 4px; }

/* ---------- tarjetas */
.cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); min-width: 0; }
.card strong { font-family: var(--display); font-size: 19px; line-height: 1.2; color: var(--ink); }
.card:hover { border-color: var(--beige); }
.card-accent { background: color-mix(in srgb, var(--beige) 14%, var(--surface)); border-color: color-mix(in srgb, var(--beige) 45%, var(--line)); }
.card .meta { font-family: var(--mono); font-size: 12px; color: var(--beige); margin-top: 4px; }
.card.is-soon { opacity: .72; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--beige); color: var(--ground); border: 0; border-radius: 999px; padding: 11px 18px; font: 700 15px/1 var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--beige); }

.install { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px dashed var(--line); }
.install div { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); font-size: 14px; }
.install strong { color: var(--ink); font-size: 15px; }
.soon { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-2); }
.soon p { margin: 6px 0 0; }

/* ---------- curso y lecciones */
.course-head { display: flex; flex-direction: column; gap: 10px; }
.course-head p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.pill { align-self: flex-start; font-family: var(--mono); font-size: 12px; color: var(--ground); background: var(--beige); border-radius: 999px; padding: 4px 10px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--beige); }
.lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lessons li + li { border-top: 1px solid var(--line); }
.lessons a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); background: var(--surface); }
.lessons a:hover { background: var(--surface-2); }
.lnum { font-family: var(--mono); font-size: 13px; color: var(--ink-3); width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; }
.lessons .done .lnum { background: var(--beige); color: var(--ground); border-color: var(--beige); }
.ltitle { font-weight: 700; }
.lsub { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.ldur { font-family: var(--mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.player { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #000 center / cover no-repeat; }
.facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.facade .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 999px; background: var(--beige); display: grid; place-items: center; z-index: 1; }
.facade .play svg { width: 26px; height: 26px; fill: var(--ground); margin-left: 4px; }
.facade .fmeta { position: absolute; left: 14px; bottom: 12px; z-index: 1; font-family: var(--mono); font-size: 12px; color: #f2ede3; }
.offline-note { font-size: 13px; color: var(--warn); margin: 0; }
.lesson-body { display: flex; flex-direction: column; gap: 12px; }
.lesson-body ul { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; max-width: 64ch; }
.lesson-body li b { color: var(--ink); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.pager a span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.pager a.next { text-align: right; }
.yt { font-size: 13px; color: var(--ink-3); }

.products { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--ink); }
.product img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.product strong { display: block; font-size: 14px; line-height: 1.3; }
.product .pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product .price { font-family: var(--mono); font-size: 13px; color: var(--beige); }
.product small { display: block; color: var(--ink-3); font-size: 12px; }

/* ---------- taller */
.contact { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
@media (min-width: 600px) { .contact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact div { display: flex; flex-direction: column; gap: 2px; }

/* ---------- hoja de instalación iPhone */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sheet-card ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* ---------- calculadora */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) {
  .calc-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .calc-left { position: sticky; top: 72px; }
}
.calc-left, .calc-right { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 6px; }
.figure svg { display: block; width: 100%; height: auto; }
.figure svg text { font-family: var(--mono); }
.figcap { font-size: 12px; color: var(--ink-3); padding: 4px 4px 6px; }
.readout { padding: 4px 2px 0; }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(54px, 13vw, 76px); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.big small { font-size: .38em; font-weight: 500; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.sub { margin-top: 10px; font-size: 16px; }
.sub .mono { font-family: var(--mono); font-size: 14px; color: var(--beige); }
.note { margin-top: 8px; font-size: 13px; color: var(--warn); }
.tipline { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.tipline b { color: var(--ink); }
.coins { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { font: 500 14px/1 var(--body); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.chip:hover { border-color: var(--beige); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--beige); border-color: var(--beige); color: var(--ground); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label span { font-weight: 700; font-size: 15px; }
.label output { font-family: var(--mono); font-size: 15px; color: var(--beige); font-variant-numeric: tabular-nums; }
.help { font-size: 13px; color: var(--ink-3); margin: 0; }
.pgroups { display: flex; flex-direction: column; gap: 12px; }
.pgroup { display: flex; flex-direction: column; gap: 6px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.presets.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preset { text-align: left; font: 500 13px/1.25 var(--body); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.preset strong { font-size: 14px; color: var(--ink); font-weight: 700; }
.preset em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.preset[aria-pressed="true"] { border-color: var(--beige); background: color-mix(in srgb, var(--beige) 14%, var(--surface-2)); }
.preset[aria-pressed="true"] em { color: var(--beige); }
input[type="range"] { width: 100%; accent-color: var(--beige); height: 28px; }
.ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding: 0 2px; }
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.stepper button { background: transparent; border: 0; color: var(--ink); font: 500 22px/1 var(--body); cursor: pointer; }
.stepper button:hover { background: color-mix(in srgb, var(--beige) 16%, transparent); }
.stepper input { min-width: 0; width: 100%; text-align: center; background: transparent; border: 0; border-inline: 1px solid var(--line); color: var(--ink); font: 500 20px/1 var(--mono); padding: 12px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { font-size: 13px; padding: 7px 11px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input { width: 20px; height: 20px; accent-color: var(--beige); }
.single { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.single p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.single p b { color: var(--ink); }
.single .btn { align-self: flex-start; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--mono); color: var(--beige); font-size: 18px; }
details[open] summary::after { content: "–"; }
.dbody { padding: 0 16px 16px; color: var(--ink-2); font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.dbody p { margin: 0; max-width: 64ch; }
.formula { font-family: var(--mono); font-size: 14px; color: var(--ink); background: var(--surface-2); border-radius: 6px; padding: 10px 12px; overflow-x: auto; }
.cointable { display: grid; grid-template-columns: auto minmax(0, 96px) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.cointable .h { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.cointable input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: 500 15px/1 var(--mono); padding: 8px; text-align: right; }
.cointable .cn { font-weight: 700; color: var(--ink); }
.cointable .src { font-size: 12px; color: var(--ink-3); }
.linkbtn { align-self: flex-start; background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 6px; padding: 7px 10px; font: 500 13px var(--body); cursor: pointer; }
.linkbtn:hover { color: var(--ink); border-color: var(--beige); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
