:root {
  --paper: #f7f3ed;
  --sand: #eae1d5;
  --ink: #241f1c;
  --muted: #786f67;
  --wine: #7b2d3b;
  --wine-deep: #5c1f2b;
  --clay: #b76e62;
  --line: rgba(36, 31, 28, .15);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: Inter, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --page: min(1080px, calc(100vw - 40px));
}
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  color: var(--ink); font: 400 16px/1.55 var(--sans);
  background: radial-gradient(circle at 4% 12%, rgba(183,110,98,.12), transparent 26%),
              radial-gradient(circle at 96% 46%, rgba(123,45,59,.06), transparent 28%), var(--paper);
}
main { flex: 1; padding-bottom: 72px; }
.gate-page main { padding-bottom: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--wine); color: var(--paper); }
.grain { position: fixed; inset: 0; z-index: 30; opacity: .09; pointer-events: none; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.wrap { width: var(--page); margin: 0 auto; }

.top { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -.05em; text-decoration: none; white-space: nowrap; }
.brand span { font: italic 400 1.34em var(--serif); color: var(--wine); }
.nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; color: var(--muted);
  padding: 8px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--wine); border-color: var(--wine); }

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; font: 400 10px var(--mono);
  letter-spacing: .13em; text-transform: uppercase; color: var(--wine); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; }
h1 { font-size: clamp(44px, 7.4vw, 76px); line-height: .94; }
h1 em, h2 em { font-style: italic; color: var(--wine); }
h2 { font-size: clamp(28px, 4vw, 38px); line-height: 1.02; }
.lead { max-width: 520px; color: var(--muted); font-size: 15px; }

.hello { padding: clamp(36px, 7vw, 76px) 0 clamp(28px, 4vw, 44px); display: grid; gap: 18px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px;
  padding: 0 22px; border: 1px solid var(--wine); background: var(--wine); color: var(--paper); cursor: pointer;
  font: 500 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  transition: background .25s ease, color .25s ease, transform .25s ease; }
.button:hover { background: var(--wine-deep); transform: translateY(-2px); }
.button.ghost { background: transparent; color: var(--wine); }
.button.ghost:hover { background: var(--wine); color: var(--paper); }
.button.small { min-height: 38px; padding: 0 14px; font-size: 10px; }
.button svg { width: 16px; height: 16px; }

.aviso { margin: 20px 0 0; padding: 13px 16px; border-left: 2px solid var(--wine); background: var(--sand); font-size: 14px; }
.erro { margin: 0 0 18px; padding: 12px 14px; border-left: 2px solid #a3352b; background: #f3dcd6; font-size: 14px; }

/* continuar */
.resume { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 22px 26px;
  margin-bottom: clamp(34px, 5vw, 56px); background: var(--ink); color: var(--paper); text-decoration: none; }
.resume .eyebrow { color: #eec7c0; }
.resume strong { display: block; margin-top: 8px; font: 400 clamp(22px, 3.2vw, 30px)/1.08 var(--serif); letter-spacing: -.03em; }
.resume small { color: rgba(247,243,237,.66); font-size: 12px; }
.play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--wine); transition: transform .25s ease; }
.resume:hover .play { transform: scale(1.08); }
.play svg { width: 18px; height: 18px; margin-left: 3px; }

/* cursos */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.count { font: 400 11px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 34px 28px; }
.course { display: grid; gap: 14px; text-decoration: none; }
.cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--wine-deep); }
.cover img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.86); transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.course:hover .cover img { transform: scale(1.05); }
.cover.empty { display: grid; place-items: center; background: linear-gradient(140deg, var(--wine), var(--wine-deep) 55%, #3b1820); }
.cover.empty span { font: italic 400 96px/1 var(--serif); color: rgba(247,243,237,.2); }
.cover .tag { position: absolute; left: 0; bottom: 0; padding: 7px 12px; background: var(--paper); font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.course h3 { font-size: 27px; line-height: 1.05; }
.course p { margin: 0; color: var(--muted); font-size: 14px; }
.bar { height: 2px; background: var(--line); }
.bar i { display: block; height: 100%; background: var(--wine); }
.empty-state { padding: 46px 0; color: var(--muted); max-width: 460px; }

/* curso */
.course-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 60px); align-items: center; padding: clamp(30px, 5vw, 60px) 0; }
.course-hero .cover { aspect-ratio: 4 / 3; }
.course-hero .stack { display: grid; gap: 20px; justify-items: start; }
.back { font: 400 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--wine); }
.module { margin-top: 44px; }
.module-title { display: flex; align-items: baseline; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.module-title b { font: 400 11px var(--mono); letter-spacing: .1em; color: var(--wine); }
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson a { display: grid; grid-template-columns: 38px 1fr auto 22px; align-items: center; gap: 14px; padding: 17px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .2s ease, padding .2s ease; }
.lesson a:hover { background: rgba(234,225,213,.6); padding-left: 12px; }
.lesson .n { font: 400 12px var(--mono); color: var(--muted); }
.lesson .t { font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.lesson .d { font: 400 11px var(--mono); color: var(--muted); white-space: nowrap; }
.lesson .ok { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: transparent; }
.lesson.done .ok { background: var(--wine); border-color: var(--wine); color: var(--paper); }
.lesson.done .t { color: var(--muted); }
.lesson .ok svg { width: 11px; height: 11px; }
.lesson.current a { background: var(--sand); padding-left: 12px; }
.draft { font: 400 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--clay); margin-left: 8px; }

/* aula */
.stage { background: #171210; }
.stage video { display: block; width: min(1180px, 100%); max-height: 76svh; margin: 0 auto; aspect-ratio: 16 / 9; background: #000; }
.lesson-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 64px); padding-top: clamp(26px, 4vw, 44px); }
.lesson-body h1 { font-size: clamp(34px, 5vw, 52px); margin: 14px 0 16px; }
.lesson-body .text { white-space: pre-line; color: #4a423c; max-width: 600px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.side h2 { font-size: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.side .lesson a { grid-template-columns: 30px 1fr 22px; padding: 13px 4px; }
.side .lesson .t { font-size: 14px; }

/* formulários */
.gate { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.gate-art { position: relative; background: var(--wine-deep) center 30% / cover no-repeat; color: var(--paper); display: flex; align-items: flex-end; padding: clamp(30px, 5vw, 64px); isolation: isolate; }
.gate-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(40,17,22,.9), rgba(40,17,22,.2) 62%); }
.gate-art p { margin: 0; font: 400 clamp(38px, 4.6vw, 66px)/.94 var(--serif); letter-spacing: -.045em; max-width: 440px; }
.gate-art em { color: #edcfca; }
.gate-form { display: grid; align-content: center; padding: clamp(32px, 6vw, 84px) clamp(22px, 6vw, 84px); }
.gate-form .in { width: min(380px, 100%); display: grid; gap: 22px; }
.gate-form h1 { font-size: clamp(38px, 5vw, 50px); }
label { display: block; margin-bottom: 7px; font: 400 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent;
  color: var(--ink); font: 400 16px var(--sans); outline: none; }
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--wine); box-shadow: 0 1px 0 var(--wine); }
.field { margin-bottom: 20px; }
.gate-form .button { width: 100%; }
.link { font-size: 13px; color: var(--muted); }
.link a { color: var(--wine); }
.narrow { width: min(460px, calc(100vw - 40px)); margin: 0 auto; padding-top: clamp(34px, 6vw, 70px); }

/* aplicativo */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 26px; margin-top: 34px; }
.panel { padding: 28px; border: 1px solid var(--line); background: rgba(247,243,237,.7); }
.panel h2 { font-size: 28px; margin-bottom: 18px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: passo; display: grid; gap: 16px; }
.steps li { counter-increment: passo; display: grid; grid-template-columns: 30px 1fr; gap: 12px; font-size: 15px; }
.steps li::before { content: counter(passo, decimal-leading-zero); font: 400 11px var(--mono); color: var(--wine); padding-top: 4px; }
.steps svg { width: 17px; height: 17px; vertical-align: -3px; color: var(--wine); }
.installed { display: none; }
.standalone .installed { display: block; }
.standalone .not-installed { display: none; }

/* painel */
.tabs { display: flex; gap: 26px; margin: 26px 0 30px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 0; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--wine); }
.grid2 { display: grid; grid-template-columns: 340px 1fr; gap: clamp(24px, 4vw, 54px); align-items: start; }
.checks { display: grid; gap: 9px; margin: 6px 0 20px; }
.checks label, .inline-check { display: flex; align-items: center; gap: 9px; margin: 0; font: 400 14px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--wine); }
.rows { border-top: 1px solid var(--ink); }
.section-head + .rows { border-top: 0; margin-top: -26px; }
details.row { border-bottom: 1px solid var(--line); }
details.row summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 15px 4px; cursor: pointer; list-style: none; }
details.row summary::-webkit-details-marker { display: none; }
details.row summary b { font-weight: 500; }
details.row summary small { display: block; color: var(--muted); font-size: 12px; }
details.row .body { padding: 6px 4px 22px; display: grid; gap: 14px; }
.pill { font: 400 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.on { border-color: var(--wine); color: var(--wine); }
.secret { padding: 18px 20px; margin-top: 20px; background: var(--ink); color: var(--paper); }
.secret code { display: block; margin-top: 10px; font: 400 15px/1.7 var(--mono); user-select: all; white-space: pre-wrap; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline .field { margin: 0; flex: 1 1 150px; }
.inline .field.xs { flex: 0 0 74px; }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log td, table.log th { text-align: left; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); }
table.log th { font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.foot { border-top: 1px solid var(--line); padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; }
.foot span { font: italic 400 17px var(--serif); color: var(--wine); }

@media (max-width: 820px) {
  .course-hero, .lesson-body, .grid2 { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; grid-template-rows: 34svh auto; }
  .gate-art { padding: 22px; }
  .gate-form { align-content: start; }
  .top-in { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 14px; }
  .nav { width: 100%; gap: 20px; }
  .resume { padding: 18px; }
  .lesson a { grid-template-columns: 28px 1fr 20px; }
  .lesson .d { grid-column: 2; grid-row: 2; margin-top: -8px; }
  .lesson .ok { grid-column: 3; grid-row: 1 / span 2; }
  .side .lesson .ok { grid-row: 1; }
  .stage video { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.button[hidden] { display: none; }
