/* Applied with AI Members Portal: design system. Brand tokens match appliedwithai.dev.
   Self-hosted font, no third-party requests. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --navy: #0D1117; --navy-light: #161B22;
  --amber: #F0A030; --amber-hover: #D88E28; --amber-glow: rgba(240,160,48,.12); --on-amber: #0D1117;
  --purple: #7C5CFC; --purple-glow: rgba(124,92,252,.12);
  --green: #2DA44E; --focus: #5B3FE0;
  --bg: #FFFFFF; --bg-alt: #F7F6F3; --card: #FFFFFF;
  --heading: #1A1A2E; --fg: #2D3748; --muted: #64748B; --line: #E2E8F0; --link: #5B3FE0;
  --on-navy: #E6EDF3; --on-navy-muted: #8B949E;
  --max-w: 1080px; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1117; --bg-alt: #11161d; --card: #161B22;
    --heading: #E6EDF3; --fg: #C9D1D9; --muted: #8B949E; --line: #262c36; --link: #9d87ff; --focus: #9d87ff;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--fg);
  background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.nav :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 2000; background: var(--amber); color: var(--on-amber);
  padding: 8px 16px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.06); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { color: #fff; font-weight: 800; letter-spacing: .06em; font-size: 15px; text-decoration: none; }
.nav-logo span { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--on-navy-muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: #fff; }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 8px;
  font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .2s, transform .2s, border-color .2s; }
.btn-primary { background: var(--amber); color: var(--on-amber); }
.btn-primary:hover { background: var(--amber-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--on-navy); border-color: rgba(255,255,255,.22); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

/* Hero */
.hero { background: var(--navy); color: var(--on-navy); position: relative; overflow: hidden;
  padding: 96px 0 88px; border-bottom: 1px solid rgba(255,255,255,.06); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 85% 0%, var(--purple-glow), transparent 70%),
              radial-gradient(500px 280px at 5% 100%, var(--amber-glow), transparent 70%); }
.hero .container { position: relative; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); background: var(--amber-glow); padding: 5px 12px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); line-height: 1.12; font-weight: 800; color: #fff; letter-spacing: -.02em; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p.lead { margin-top: 22px; max-width: 58ch; font-size: 18px; color: var(--on-navy-muted); }
.cta-row { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.fine { margin-top: 18px; font-size: 13px; color: var(--on-navy-muted); }
.fine a { color: var(--on-navy); }

/* Sections */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-intro { margin-bottom: 44px; max-width: 60ch; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); margin-bottom: 10px; }
.section h2 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; color: var(--heading); font-weight: 800; letter-spacing: -.015em; }
.section-intro p { margin-top: 12px; color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 800px) { .grid-3 { grid-template-columns: 1fr; } .section { padding: 60px 0; } .hero { padding: 64px 0; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: rgba(240,160,48,.4); box-shadow: 0 4px 20px rgba(240,160,48,.07); }
.card h3 { font-size: 17px; color: var(--heading); font-weight: 650; margin-bottom: 8px; line-height: 1.35; }
.card p { font-size: 14.5px; color: var(--muted); line-height: 1.65; }
.icon { width: 40px; height: 40px; border-radius: 9px; background: var(--purple-glow); color: var(--purple);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.icon svg { width: 20px; height: 20px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--amber); color: var(--on-amber);
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--amber); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* Footer */
.site-footer { background: var(--navy); color: var(--on-navy-muted); padding: 40px 0; font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: var(--on-navy); text-decoration: none; margin-right: 18px; }
.site-footer a:last-child { margin-right: 0; }
.site-footer a:hover { color: var(--amber); }

/* Legal / long-form pages */
.page-head { background: var(--navy); color: var(--on-navy); padding: 40px 0 32px; border-bottom: 1px solid rgba(255,255,255,.06); }
.page-head h1 { color: #fff; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-head .meta { color: var(--on-navy-muted); margin-top: 10px; font-size: 14px; }
.prose { max-width: 820px; margin: 0 auto; padding: 28px 24px 80px; }
.prose h2 { font-size: 1.35rem; color: var(--heading); margin: 2.4rem 0 .5rem; line-height: 1.3; }
.prose h3 { font-size: 1.05rem; color: var(--heading); margin: 1.4rem 0 .3rem; }
.prose p, .prose li { margin: .55rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose .meta { color: var(--muted); font-size: .92rem; }
.prose .summary, .prose .notice, .prose .toc { background: var(--bg-alt); border: 1px solid var(--line);
  border-left: 4px solid var(--amber); border-radius: var(--radius); padding: 14px 18px; margin: 1.2rem 0; }
.prose .toc { border-left-color: var(--purple); }
.prose .toc ol { columns: 2; column-gap: 32px; margin: .3rem 0; }
@media (max-width: 640px) { .prose .toc ol { columns: 1; } }
.prose table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-alt); color: var(--heading); }
/* Owner-fill placeholders stay highlighted so they are not missed before launch */
.ph { background: #fff3bf; color: #1a1d23; padding: 0 4px; border-radius: 3px; }

/* Sign-in landing */
body.landing { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy); color: var(--on-navy); }
.signin { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; position: relative;
  background: radial-gradient(600px 320px at 85% 0%, var(--purple-glow), transparent 70%),
              radial-gradient(500px 300px at 5% 100%, var(--amber-glow), transparent 70%); }
.signin-panel { width: 100%; max-width: 640px; }
.signin-panel h1 { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.notice-box { margin-top: 24px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.12); border-left: 4px solid var(--amber);
  border-radius: var(--radius); background: rgba(255,255,255,.03); color: var(--on-navy); }
.notice-box p { margin: 0; font-size: 15.5px; }
.notice-box p + p { margin-top: 10px; }
.notice-box strong { color: #fff; }
.signin-panel .cta-row { flex-wrap: nowrap; }
.signin-panel .cta-row .btn { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
@media (max-width: 480px) { .signin-panel .cta-row .btn { padding: 13px 10px; font-size: 14px; } }

/* Course player */
body.app { min-height: 100vh; display: flex; flex-direction: column; }
.player { flex: 1; display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; align-content: start; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; background: var(--bg-alt);
  border-right: 1px solid var(--line); padding: 20px 14px 40px; }
.sidebar-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 12px; }
.topic { border-radius: 8px; }
.topic + .topic { margin-top: 4px; }
.topic summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 12px 10px; border-radius: 8px; font-weight: 650; color: var(--heading); }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::before { content: ""; flex: 0 0 8px; height: 8px; margin-right: 2px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.topic[open] > summary::before { transform: rotate(45deg); }
.topic summary:hover { background: var(--amber-glow); }
.topic-name { flex: 1; }
.topic-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.topic ul { list-style: none; margin: 2px 0 8px 18px; border-left: 1px solid var(--line); }
.sub-link { display: block; padding: 9px 12px; margin-left: -1px; border-left: 3px solid transparent; font-size: 14.5px;
  line-height: 1.4; color: var(--fg); text-decoration: none; border-radius: 0 6px 6px 0; }
.sub-link:hover { background: var(--amber-glow); color: var(--heading); }
.sub-link[aria-current="true"] { border-left-color: var(--amber); background: var(--amber-glow); color: var(--heading); font-weight: 600; }
.pad { padding: 6px 12px 10px 30px; font-size: 14px; }
.stage { padding: 48px 56px 72px; min-width: 0; outline: none; }
.detail { max-width: 760px; }
.detail h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; font-weight: 800; color: var(--heading); letter-spacing: -.02em; outline: none; }
.detail-desc { margin-top: 14px; font-size: 17px; color: var(--muted); }
.detail section { margin-top: 36px; }
.detail h2 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.resources { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.resource { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); }
.resource-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.resource-main strong { color: var(--heading); }
.resource-main .muted { font-size: 13px; }
.muted { color: var(--muted); }
.lock { width: 36px; height: 36px; border-radius: 8px; background: var(--amber-glow); color: var(--amber-hover);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lock svg { width: 18px; height: 18px; }
.btn-locked { background: transparent; border-color: var(--line); color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .player { grid-template-columns: 1fr; }
  .menu-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 24px; font: inherit; font-weight: 600;
    color: var(--heading); background: var(--bg-alt); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .sidebar { display: none; position: static; height: auto; max-height: 60vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar.open { display: block; }
  .stage { padding: 32px 24px 56px; }
  .resource { flex-wrap: wrap; }
  .resource .btn { width: 100%; justify-content: center; }
}

/* Auth */
.who { color: var(--on-navy); font-size: 14px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert { margin-top: 18px; padding: 12px 16px; border-radius: 8px; border: 1px solid #f0627a; background: rgba(240,98,122,.12); color: #ffd9df; font-size: 14.5px; }
.nav-links { display: flex; align-items: center; gap: 14px; }
.nav-links #auth-slot { display: flex; align-items: center; gap: 12px; }
@media (max-width: 560px) { .who { display: none; } }

/* Account deletion */
.sidebar-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted);
  text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--heading); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg);
  padding: 0; max-width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(13,17,23,.6); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body h2 { color: var(--heading); font-size: 20px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.btn-ghost-dark { background: transparent; color: var(--heading); border-color: var(--line); }
.btn-ghost-dark:hover { border-color: var(--heading); }
.btn-danger { background: #B42318; color: #fff; border-color: #B42318; }
.btn-danger:hover { background: #912018; }
.alert-ok { border-color: var(--green); }
.dialog-body .alert { color: var(--heading); margin-top: 0; }
.alert-ok { background: rgba(45,164,78,.14); color: var(--on-navy); }
