:root {
  color-scheme: light;
  --ink: #14202e;
  --muted: #5c6878;
  --line: #d7e0e8;
  --page: #f3f7fb;
  --panel: #ffffff;
  --blue: #1f66d1;
  --green: #157f5b;
  --yellow: #f4c542;
  --red: #d24b35;
  font-family:
    "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(31, 102, 209, 0.12), transparent 35%),
    linear-gradient(300deg, rgba(21, 127, 91, 0.11), transparent 32%),
    var(--page);
}

.deck {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.deck-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 140px;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.18;
  letter-spacing: 0;
}

p,
li {
  color: var(--muted);
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.7;
}

.answer-badge {
  display: grid;
  place-items: center;
  width: 132px;
  min-width: 132px;
  aspect-ratio: 1;
  border: 3px solid #173d7a;
  border-radius: 8px;
  color: #173d7a;
  background: #fff7d1;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.slide {
  display: grid;
  min-height: 580px;
  margin: 24px 0;
  padding: clamp(22px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(25, 38, 54, 0.11);
}

.hero-slide {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 32px;
  align-items: center;
}

.given-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.given-list div {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.given-list dt {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.given-list dd {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
}

.circuit-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 2px solid #183d6f;
  border-radius: 8px;
  background: #f8fbff;
}

.wire {
  position: absolute;
  left: 17%;
  right: 17%;
  height: 6px;
  background: #183d6f;
}

.wire.top {
  top: 28%;
}

.wire.bottom {
  bottom: 28%;
}

.resistor,
.battery,
.current {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.resistor {
  top: 20%;
  width: 150px;
  height: 70px;
  border: 4px solid var(--red);
  color: var(--red);
  background: #fff2ef;
  font-size: 32px;
}

.battery {
  bottom: 18%;
  width: 120px;
  height: 76px;
  border: 4px solid var(--green);
  color: var(--green);
  background: #ecfaf4;
  font-size: 30px;
}

.current {
  right: 10%;
  top: 43%;
  padding: 10px 14px;
  color: #173d7a;
  background: #fff7d1;
  font-size: 24px;
}

.formula-slide,
.calc-slide,
.final-slide,
.check-slide {
  align-content: center;
}

.formula-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 8px 0 28px;
}

.formula-card span,
.formula-card small {
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 96px;
  border-radius: 8px;
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 900;
}

.formula-card span {
  color: #ffffff;
  background: var(--blue);
}

.formula-card small {
  min-width: 48px;
  color: var(--ink);
  background: transparent;
}

.calculation {
  display: grid;
  gap: 10px;
  max-width: 620px;
  margin-bottom: 20px;
}

.calculation p {
  margin: 0;
  padding: 16px 20px;
  border-left: 8px solid var(--blue);
  border-radius: 8px;
  color: var(--ink);
  background: #edf4ff;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
}

.calculation .result {
  border-color: var(--green);
  background: #ebf8f1;
}

.big-answer {
  color: var(--green);
  font-size: clamp(92px, 18vw, 190px);
  font-weight: 900;
  line-height: 1;
}

.check-slide ul {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin: 0;
  padding-left: 1.2em;
}

.check-slide strong {
  color: var(--ink);
}

@media (max-width: 820px) {
  .deck-header,
  .hero-slide {
    grid-template-columns: 1fr;
  }

  .deck-header {
    align-items: start;
  }

  .answer-badge {
    width: 112px;
    min-width: 112px;
    font-size: 21px;
  }

  .slide {
    min-height: auto;
  }

  .given-list {
    grid-template-columns: 1fr;
  }
}
