:root {
  color-scheme: light;
  --bg: #f7f8f2;
  --paper: #fff;
  --ink: #192b21;
  --muted: #57665b;
  --border: #e0e6da;
  --forest: #142c20;
  --forest-deep: #10261b;
  --lime: #c7ef76;
  --lime-hover: #b7e45c;
  --green: #235941;
  --soft-green: #edf4e9;
  --focus: #397454;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.55; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(100% - 3rem, 73.75rem); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 3;
  top: .6rem;
  left: .75rem;
  transform: translateY(-140%);
  padding: .6rem .95rem;
  border-radius: .5rem;
  color: white;
  background: var(--forest);
}
.skip-link:focus { transform: none; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--border); }
.header-inner {
  min-height: 4.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .63rem;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -.065em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark img { flex: none; border-radius: .68rem; }
.navigation { display: flex; align-items: center; gap: .32rem; }
.navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: .42rem .78rem;
  border-radius: .63rem;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.navigation a:hover, .navigation a[aria-current="page"] { color: var(--green); background: var(--soft-green); }
.navigation a[aria-current="page"] { font-weight: 750; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: .58rem .95rem;
  border: 1px solid transparent;
  border-radius: .67rem;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.button-secondary {
  color: var(--green);
  border-color: #dbe5d8;
  background: var(--paper);
}
.button-secondary:hover:not(:disabled) { background: var(--soft-green); border-color: #c9dac7; }
.button-primary { color: #1a2e16; background: var(--lime); }
.button-primary:hover:not(:disabled) { background: var(--lime-hover); }
.button-primary:disabled { color: #355e44; background: #e7f1e5; }
.button-secondary:disabled { color: var(--muted); opacity: .62; }
.button-hero { color: #f1f6ee; border-color: #647969; background: #233e2f; }
.button-hero:hover { background: #33513f; }
.button-hero:focus-visible, .hero .button-primary:focus-visible { outline-color: var(--lime); }
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 .14rem;
  border: 0;
  border-radius: .28rem;
  color: var(--green);
  background: transparent;
  font-size: .88rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .23em;
}
.text-button:hover { color: var(--forest); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 23rem;
  overflow: hidden;
  margin-top: 1.65rem;
  border-radius: 1.45rem;
  isolation: isolate;
  color: white;
  background: var(--forest-deep);
}
.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 2.7rem clamp(2rem, 5vw, 4rem);
}
.hero h1 {
  font-size: clamp(3rem, 6vw, 5.05rem);
  letter-spacing: -.083em;
  font-weight: 800;
  line-height: .99;
}
.hero em { color: var(--lime); font-style: normal; }
.hero p { max-width: 26rem; margin-top: 1.1rem; color: #d7e4d9; font-size: 1.06rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.35rem; }
.hero-actions .button { min-height: 2.9rem; padding-inline: 1.04rem; }
.hero-media { position: relative; min-width: 0; background: #142e20; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 54% 50%; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--forest-deep), transparent 30%);
  pointer-events: none;
}

.workspace { margin: 2.15rem 0 3.2rem; scroll-margin-top: 1rem; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.section-heading h2 { font-size: clamp(1.75rem, 3.8vw, 2.5rem); line-height: 1.13; font-weight: 790; letter-spacing: -.065em; }
.section-heading p { margin-top: .3rem; color: var(--muted); }
.progress-panel {
  display: grid;
  gap: .27rem;
  flex: none;
  width: min(19rem, 40%);
  padding: .66rem .82rem;
  border: 1px solid var(--border);
  border-radius: .78rem;
  color: var(--muted);
  background: #f0f4eb;
  font-size: .83rem;
}
.progress-panel > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 .6rem; }
.progress-panel strong { color: var(--green); }
.progress-panel small { font-size: .78rem; }
progress {
  display: block;
  width: 100%;
  height: .48rem;
  appearance: none;
  border: 0;
  border-radius: .35rem;
  overflow: hidden;
  color: #3e7954;
  background: #dce7d7;
  accent-color: #3e7954;
}
progress::-webkit-progress-bar { background: #dce7d7; }
progress::-webkit-progress-value { background: #3e7954; }
progress::-moz-progress-bar { background: #3e7954; }

.academy-layout, .chart-layout, .tool-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(16rem, 27%) minmax(0, 1fr);
  gap: 1.1rem;
}
.chart-layout { grid-template-columns: minmax(0, 1fr) minmax(15.75rem, 27%); }
.tool-layout { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); }
.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 2px 6px #152b1f07;
}
.lesson-directory { padding: .98rem; }
.lesson-directory h3 { margin: 0 0 .65rem .28rem; font-size: 1.05rem; letter-spacing: -.035em; }
.lesson-list { display: grid; gap: .32rem; }
.lesson-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  min-height: 2.95rem;
  padding: .55rem .64rem;
  border: 1px solid transparent;
  border-radius: .58rem;
  color: var(--ink);
  background: var(--paper);
  font-size: .94rem;
  text-align: left;
}
.lesson-select:hover { background: #f5f8f1; }
.lesson-select[aria-pressed="true"] { border-color: #d6e5ce; color: #214e33; background: #edf5e7; }
.lesson-name { font-weight: 690; }
.lesson-side { display: flex; align-items: center; gap: .3rem; flex: none; }
.lesson-duration { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.lesson-state { color: var(--green); font-size: .88rem; font-weight: 820; }

.lesson { padding: clamp(1.22rem, 3.5vw, 2.55rem); }
.lesson-meta { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .87rem; }
.lesson-meta span + span::before { content: "·"; margin-right: .5rem; }
.lesson-meta span:first-child { color: var(--green); font-weight: 720; }
.lesson h2 {
  margin-top: .28rem;
  font-size: clamp(1.98rem, 4.3vw, 3rem);
  line-height: 1.08;
  font-weight: 790;
  letter-spacing: -.065em;
  overflow-wrap: anywhere;
}
.lesson-intro { max-width: 53rem; margin-top: .72rem; font-size: 1.08rem; color: #475b4b; }
.lesson-body { display: grid; gap: .94rem; margin-top: 1.38rem; }
.lesson-part h3 { font-size: 1.03rem; letter-spacing: -.023em; }
.lesson-part p { max-width: 53rem; margin-top: .2rem; color: #3f5143; }
.example-box { margin-top: 1.18rem; padding: .85rem 1rem; border: 1px solid #dce7d2; border-radius: .7rem; background: #f2f7ea; }
.example-box h3 { color: var(--green); font-size: .91rem; }
.example-box p { margin-top: .2rem; color: #395041; }
.lesson-activity:empty { display: none; }
.lesson-activity { margin-top: .87rem; }
.lesson-more { margin-top: .85rem; overflow-wrap: anywhere; }
.source-link { color: var(--green); font-size: .9rem; text-decoration-thickness: .06rem; text-underline-offset: .18em; }
.lesson-footer { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1.08rem; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.lesson-status { margin-top: .45rem; color: var(--muted); font-size: .9rem; }
.lesson-status:empty, .field-feedback:empty { display: none; }

.chart-panel, .inspector, .calculator, .risk-results, .quiz-card { padding: clamp(1.02rem, 2.5vw, 1.55rem); }
.chart-header, .form-header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.chart-header p { margin-top: .16rem; color: var(--muted); font-size: .88rem; }
.chart-header h3, .form-header h3, .inspector h3, .risk-results h3 { font-weight: 770; font-size: 1.17rem; letter-spacing: -.034em; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .3rem; color: #435948; font-size: .88rem; font-weight: 720; }
.field select, .field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .48rem .64rem;
  border: 1px solid #d7e2d5;
  border-radius: .58rem;
  color: var(--ink);
  background: #fdfefc;
  font-variant-numeric: tabular-nums;
}
.field select {
  appearance: none;
  padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 48%, #55705b 52%), linear-gradient(135deg, #55705b 48%, transparent 52%);
  background-position: right 1rem center, right .68rem center;
  background-size: .32rem .34rem;
  background-repeat: no-repeat;
}
.field input { appearance: textfield; }
.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { appearance: none; }
.field input:user-invalid { border-color: #9d524a; }
.chart-field { flex: 0 1 10.3rem; }
.chart-frame { margin-top: 1rem; border: 1px solid #28483a; border-radius: .8rem; background: #152b22; }
#candle-chart { display: block; width: 100%; font: 14px system-ui, sans-serif; }
#candle-chart g { cursor: pointer; }
.chart-selected { fill: #d3eecc18; }
.chart-grid { stroke: #385445; stroke-width: 1; }
.chart-label { fill: #c2d5c7; }
.chart-hit { fill: transparent; }
.chart-up { color: #a8e667; }
.chart-down { color: #ff957e; }
.chart-wick { stroke: currentColor; stroke-width: 2; }
.chart-body { fill: currentColor; }
.chart-note, .tool-note { margin-top: .84rem; color: var(--muted); font-size: .92rem; }

.candle-details { margin-top: .66rem; color: var(--muted); font-size: .91rem; }
.candle-direction { margin-top: .2rem; font-weight: 700; }
.candle-direction[data-direction="up"] { color: #276348; }
.candle-direction[data-direction="down"] { color: #9a4637; }
.data-list { margin-top: .48rem; }
.data-list > div { display: flex; justify-content: space-between; gap: .65rem; padding-block: .48rem; border-bottom: 1px solid var(--border); }
.data-list dt { color: var(--muted); }
.data-list dd { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.candle-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .88rem; }
.candle-actions .button { flex: 1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .88rem; margin-top: .74rem; }
.field-feedback { margin-top: .7rem; color: #81483e; font-size: .9rem; }
.risk-number {
  display: grid;
  gap: .09rem;
  margin: .72rem 0 .68rem;
  padding: .88rem .95rem;
  border-radius: .71rem;
  color: var(--green);
  background: var(--soft-green);
  font-size: .86rem;
}
#risk-quantity { font-weight: 810; font-size: clamp(1.7rem, 5vw, 2.25rem); letter-spacing: -.058em; line-height: 1.04; overflow-wrap: anywhere; }
.risk-results .data-list { font-size: .94rem; }
#risk-results[hidden] + .tool-note { padding-top: .54rem; border-top: 1px solid var(--border); }

.quiz-card { max-width: 49rem; }
.quiz-card h3 { margin-top: .6rem; font-size: clamp(1.25rem, 3.9vw, 1.68rem); letter-spacing: -.037em; }
.quiz-progress { display: grid; gap: .45rem; color: var(--muted); font-weight: 640; font-size: .88rem; }
.quiz-options { display: grid; gap: .56rem; margin-top: .9rem; }
.quiz-option {
  min-height: 2.8rem;
  padding: .62rem .82rem;
  border: 1px solid #dbe6d8;
  border-radius: .67rem;
  color: var(--ink);
  background: #f9fbf7;
  text-align: left;
  font-size: .96rem;
}
.quiz-option:hover:not(:disabled), .quiz-option[data-result="correct"] { border-color: #b8d8b4; background: #eaf5e6; }
.quiz-option[data-result="incorrect"] { border-color: #e6b5a7; background: #fbece8; }
.quiz-explanation { margin: .8rem 0; color: var(--green); font-size: .95rem; }
.best-score { font-size: .9rem; font-weight: 690; }
.quiz-summary h3 { margin-top: 0; }
.quiz-summary .score { margin-top: .23rem; color: var(--green); font-size: 3.2rem; font-weight: 800; letter-spacing: -.06em; }
.quiz-summary .lesson-actions { margin-top: 1rem; }
#score-line { color: var(--muted); }

.notice {
  margin-bottom: 1rem;
  padding: .62rem .82rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: white;
  color: var(--muted);
}
.site-footer { border-top: 1px solid var(--border); background: var(--paper); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 5.1rem; padding-block: .75rem; }
.footer-inner strong { letter-spacing: -.04em; }
.footer-inner p { color: var(--muted); font-size: .89rem; }
.footer-inner a { color: var(--green); font-size: .91rem; text-underline-offset: .16em; }

@media (max-width: 58rem) {
  .wrap { width: calc(100% - 2rem); }
  .navigation { gap: .2rem; }
  .navigation a { padding-inline: .59rem; }
  .hero-copy { padding-inline: 1.6rem; }
  .hero { min-height: 20rem; }
  .academy-layout { grid-template-columns: minmax(14.3rem, 32%) minmax(0, 1fr); }
}

@media (max-width: 43rem) {
  .header-inner { flex-wrap: wrap; align-content: center; row-gap: .2rem; padding-block: .57rem .37rem; }
  .navigation { flex: 1 0 100%; flex-wrap: wrap; }
  .navigation a { min-height: 2.42rem; padding-inline: .55rem; font-size: .86rem; }
  .hero { margin-top: 1rem; min-height: 18.5rem; grid-template-columns: 1.04fr 1fr; }
  .hero h1 { font-size: clamp(2.55rem, 8vw, 3.45rem); }
  .hero-copy { padding: 1.4rem 1.25rem; }
  .hero p { font-size: .97rem; }
  .academy-layout, .chart-layout, .tool-layout { grid-template-columns: minmax(0, 1fr); gap: .83rem; }
  .lesson-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-select { border-color: #edf0e9; padding-inline: .45rem; font-size: .88rem; }
  .lesson-side { gap: .18rem; }
  .section-heading { flex-wrap: wrap; gap: .72rem; align-items: baseline; }
  .progress-panel { width: min(21rem, 100%); }
}

@media (max-width: 34rem) {
  .wrap { width: calc(100% - 1.4rem); }
  .site-header .wordmark { font-size: 1.25rem; }
  .wordmark img { width: 34px; height: 34px; }
  .hero { grid-template-columns: minmax(0, 1fr); border-radius: 1rem; }
  .hero h1 { font-size: clamp(2.62rem, 10.5vw, 3.62rem); }
  .hero p { margin-top: .75rem; }
  .hero-actions { margin-top: .95rem; }
  .hero-actions .button { min-height: 2.75rem; }
  .hero-media { min-height: 9.4rem; aspect-ratio: 2.15; }
  .hero-media::after { background: linear-gradient(180deg, #10261b70, transparent 36%); }
  .hero-media img { object-position: 50% 48%; }
  .workspace { margin-top: 1.45rem; margin-bottom: 2.1rem; }
  .lesson-select { align-items: flex-start; flex-direction: column; gap: .16rem; }
  .chart-header { flex-wrap: wrap; align-items: baseline; }
  .chart-field { flex-basis: 100%; }
  .form-grid { gap: .68rem; }
  .footer-inner { flex-wrap: wrap; gap: .5rem; }
}

@media (max-width: 22rem) {
  .navigation { justify-content: space-between; gap: 0; }
  .navigation a { padding-inline: .27rem; font-size: .79rem; }
  .hero h1 { font-size: 2.28rem; }
  .hero-actions .button { padding-inline: .61rem; font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}


.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; }
.privacy-page { max-width: 49rem; margin-inline: auto; }
.privacy-page h1 { font-size: clamp(1.85rem, 5vw, 2.8rem); line-height: 1.13; letter-spacing: -.05em; }
.privacy-page h2 { font-size: 1.15rem; letter-spacing: -.025em; }
.privacy-page a { color: var(--green); text-underline-offset: .18em; }
