:root {
  --black: #070707;
  --charcoal: #171717;
  --graphite: #303238;
  --silver: #d7d9dc;
  --mist: #f3f4f4;
  --white: #ffffff;
  --red: #d5001c;
  --red-dark: #9b0014;
  --gold: #c7a15d;
  --line: rgba(7, 7, 7, 0.13);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--black);
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.035) 1px, transparent 1px) 0 0 / 74px 74px,
    linear-gradient(180deg, #fbfbfb 0%, #eceef0 48%, #ffffff 100%);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 56px);
  color: var(--white);
  background: rgba(7, 7, 7, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: var(--red);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--silver);
  font-size: 0.76rem;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

nav a {
  padding: 9px 11px;
  color: var(--silver);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

nav a:hover,
nav a:focus {
  color: var(--white);
  background: rgba(255, 255, 255, 0.11);
  outline: none;
}

.section-band {
  padding: clamp(44px, 6vw, 88px) clamp(18px, 4vw, 56px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  align-items: end;
  gap: clamp(22px, 4vw, 54px);
  min-height: calc(100vh - 74px);
  overflow: hidden;
  color: var(--white);
  background: var(--black);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.94), rgba(7, 7, 7, 0.36) 46%, rgba(7, 7, 7, 0.24)),
    linear-gradient(180deg, rgba(7, 7, 7, 0.1), rgba(7, 7, 7, 0.72)),
    url("assets/porsche-crash-course-hero.png") center / cover;
  transform: scale(1.02);
}

.hero-content,
.anchor-strip {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 760px;
  padding: 10vh 0 12vh;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(4rem, 10vw, 9.8rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 660px;
  color: #e6e8eb;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.58;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.button.primary:hover {
  background: var(--red-dark);
}

.button.ghost {
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.anchor-strip {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 9px;
  padding-bottom: 12vh;
}

.anchor-strip span {
  display: block;
  padding: 12px 14px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  font-weight: 850;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  background: var(--white);
}

.stat-panel {
  min-height: 164px;
  padding: 24px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-panel span {
  display: block;
  color: var(--red);
  font-size: 3.2rem;
  font-weight: 950;
  line-height: 0.9;
}

.stat-panel strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.stat-panel p,
.section-title p,
.info-card p,
.detail-panel p,
.culture-card p,
.race-card p {
  color: #5e6269;
  line-height: 1.55;
}

.redline {
  color: var(--white);
  background: var(--black);
}

.redline p {
  color: var(--silver);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(280px, 1fr);
  gap: 16px 34px;
  align-items: end;
  margin-bottom: 28px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.8rem);
  line-height: 0.94;
}

.section-title p:last-child {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.timeline-wrap,
.family-layout,
.engine-layout,
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.timeline-rail,
.family-tree,
.engine-controls,
.buyer-form,
.knowledge-panel,
.flash-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.06);
}

.timeline-rail {
  display: grid;
  gap: 10px;
}

.timeline-button,
.family-node,
.engine-button,
.choice-button,
.answer-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.timeline-button {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
}

.timeline-button strong {
  color: var(--red);
  font-size: 1.12rem;
}

.timeline-button.active,
.family-node.active,
.engine-button.active,
.choice-button.active {
  color: var(--white);
  background: var(--black);
  border-color: var(--black);
  box-shadow: inset 4px 0 0 var(--red);
}

.detail-panel,
.result-panel {
  min-height: 360px;
  padding: clamp(20px, 3vw, 34px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-panel img,
.result-panel img,
.info-card img,
.race-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--silver), var(--white));
}

.detail-panel h3,
.result-panel h3 {
  margin: 18px 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1;
}

.why-box,
.insider-box {
  margin-top: 18px;
  padding: 16px;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-list span {
  padding: 7px 9px;
  color: var(--graphite);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.family-tree {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.family-node strong,
.engine-button strong {
  display: block;
  margin-bottom: 5px;
}

.family-node small,
.engine-button small {
  color: inherit;
  opacity: 0.75;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.generation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.generation-card {
  display: grid;
}

.generation-model {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.generation-photo {
  position: relative;
  margin: 0;
  background: var(--black);
}

.generation-photo figcaption {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 4;
  padding: 7px 9px;
  color: var(--white);
  background: rgba(7, 7, 7, 0.7);
  border-left: 4px solid var(--red);
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.photo-fallback {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(180deg, #202226, #070707);
  border-bottom: 1px solid var(--line);
}

.generation-photo:not(.photo-failed) .photo-fallback {
  display: none;
}

.studio-light,
.car-shadow,
.car-body,
.car-roof,
.front-lamp,
.rear-lamp,
.wheel {
  position: absolute;
  display: block;
}

.studio-light {
  inset: 0;
  background: radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--paint), white 24%), transparent 34%);
  opacity: 0.48;
}

.car-shadow {
  left: 12%;
  right: 10%;
  bottom: 38px;
  height: 22px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  filter: blur(8px);
}

.car-body {
  left: 11%;
  right: 8%;
  bottom: 58px;
  height: 72px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 42%),
    var(--paint);
  border-radius: 58% 42% 18px 22px / 62% 66% 20px 22px;
  box-shadow: inset 0 -16px 22px rgba(0, 0, 0, 0.22);
}

.car-roof {
  left: 33%;
  bottom: 112px;
  width: 30%;
  height: 60px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 46%),
    var(--paint);
  border-radius: 80% 70% 12% 10% / 88% 90% 12% 12%;
  transform: skewX(-13deg);
}

.front-lamp {
  right: 9%;
  bottom: 97px;
  width: 24px;
  height: 15px;
  background: #fff2c4;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.rear-lamp {
  left: 13%;
  bottom: 87px;
  width: 22px;
  height: 9px;
  background: var(--red);
  border-radius: 999px;
}

.wheel {
  bottom: 42px;
  width: 58px;
  height: 58px;
  background:
    radial-gradient(circle, #cfd3d8 0 16%, #202226 17% 38%, #060606 39% 100%);
  border: 5px solid #101010;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.front-wheel {
  right: 18%;
}

.rear-wheel {
  left: 23%;
}

.info-card,
.culture-card,
.race-card,
.trim-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.info-card:hover,
.culture-card:hover,
.race-card:hover,
.trim-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.info-card .card-body,
.race-card .card-body,
.trim-card,
.culture-card {
  padding: 18px;
}

.info-card h3,
.culture-card h3,
.race-card h3,
.trim-card h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.meta-grid span {
  padding: 10px;
  background: var(--mist);
  border-radius: var(--radius);
  font-size: 0.84rem;
}

.meta-grid strong {
  display: block;
  margin-bottom: 4px;
}

.visual-cue {
  display: grid;
  grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 16px 0;
  padding: 10px;
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.visual-cue strong {
  display: block;
  margin-bottom: 6px;
  color: var(--black);
  font-size: 1rem;
}

.visual-cue p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.cue-plate {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #f4f5f5, #c7ccd1);
  border: 1px solid rgba(7, 7, 7, 0.12);
  border-radius: var(--radius);
}

.cue-plate span {
  position: absolute;
  display: block;
}

.cue-nose {
  left: 18%;
  right: 18%;
  top: 26%;
  height: 58%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 48%),
    #d8dade;
  border: 2px solid rgba(7, 7, 7, 0.2);
  border-radius: 48% 48% 18px 18px / 34% 34% 28px 28px;
}

.cue-hood {
  left: 37%;
  top: 22%;
  width: 26%;
  height: 46%;
  border: 2px solid rgba(7, 7, 7, 0.16);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.cue-light {
  top: 45%;
  width: 24px;
  height: 24px;
  background: #fff5c8;
  border: 3px solid rgba(7, 7, 7, 0.28);
  border-radius: 50%;
}

.cue-light.left {
  left: 29%;
}

.cue-light.right {
  right: 29%;
}

.cue-bumper {
  left: 21%;
  right: 21%;
  bottom: 18%;
  height: 12px;
  background: #111;
  border-radius: 999px;
}

.cue-extra {
  opacity: 0;
}

.cue-impact .cue-extra {
  left: 17%;
  bottom: 16%;
  width: 15%;
  height: 28px;
  background: repeating-linear-gradient(90deg, #111 0 5px, #34363a 5px 10px);
  border-radius: 4px;
  opacity: 1;
  box-shadow: 176px 0 0 #111;
}

.cue-fried .cue-light {
  width: 38px;
  height: 28px;
  background:
    radial-gradient(circle at 70% 50%, #ffad20 0 24%, transparent 25%),
    #fff2c4;
  border-radius: 58% 42% 44% 56%;
}

.cue-round .cue-light {
  width: 30px;
  height: 30px;
  border-width: 4px;
}

.cue-integrated .cue-bumper,
.cue-993 .cue-bumper,
.cue-991 .cue-bumper,
.cue-992 .cue-bumper {
  height: 18px;
  background: linear-gradient(180deg, #e4e6e8, #8f969d);
  border: 1px solid rgba(7, 7, 7, 0.18);
}

.cue-993 .cue-nose {
  border-radius: 58% 58% 22px 22px / 26% 26% 26px 26px;
}

.cue-991 .cue-nose,
.cue-992 .cue-nose {
  left: 14%;
  right: 14%;
}

.cue-992 .cue-extra {
  left: 20%;
  right: 20%;
  bottom: 11%;
  height: 5px;
  background: var(--red);
  opacity: 1;
  border-radius: 999px;
}

.color-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 2px;
}

.color-strip span {
  display: grid;
  gap: 7px;
  min-height: 78px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--graphite);
  font-size: 0.76rem;
  font-weight: 850;
}

.color-strip i {
  display: block;
  height: 28px;
  border: 1px solid rgba(7, 7, 7, 0.22);
  border-radius: 5px;
  box-shadow: inset 0 12px 18px rgba(255, 255, 255, 0.2);
}

.engine-school {
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(7, 7, 7, 0.96), rgba(45, 47, 52, 0.96)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Porsche%20911%20Carrera%20S%20%28992%29%20at%20IAA%202019%20IMG%200631.jpg?width=1600") center / cover;
}

.engine-school .section-title p:last-child,
.engine-school .detail-panel p {
  color: #cfd3d8;
}

.engine-school .detail-panel,
.engine-school .engine-controls {
  color: var(--black);
}

.engine-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(260px, 0.5fr) minmax(340px, 0.9fr);
}

.engine-visual {
  position: relative;
  min-height: 430px;
  background:
    radial-gradient(circle at center, rgba(213, 0, 28, 0.18), transparent 36%),
    linear-gradient(145deg, #111, #2a2c30);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.engine-visual::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 48%;
  height: 52px;
  background: linear-gradient(90deg, #898d94, #f1f2f3, #868b91);
  border-radius: 999px;
  transform: translateY(-50%);
}

.fan,
.crank,
.piston {
  position: absolute;
  display: block;
}

.fan {
  left: 50%;
  top: 50%;
  width: 116px;
  height: 116px;
  border: 12px solid var(--silver);
  border-top-color: var(--red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 1.8s linear infinite;
}

.crank {
  left: 18%;
  right: 18%;
  top: 50%;
  height: 8px;
  background: var(--red);
  transform: translateY(-50%);
}

.piston {
  width: 70px;
  height: 52px;
  background: linear-gradient(180deg, #f2f3f4, #8c9198);
  border: 3px solid #303238;
  border-radius: var(--radius);
  animation: pulse 1.8s ease-in-out infinite;
}

.p1,
.p2,
.p3 {
  left: 14%;
}

.p4,
.p5,
.p6 {
  right: 14%;
}

.p1,
.p4 {
  top: 23%;
}

.p2,
.p5 {
  top: 43%;
  animation-delay: 0.3s;
}

.p3,
.p6 {
  top: 63%;
  animation-delay: 0.6s;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    transform: translateX(18px);
  }
}

.engine-controls {
  display: grid;
  gap: 10px;
}

.trim-board,
.culture-grid,
.race-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trim-card {
  display: grid;
  gap: 12px;
}

.trim-card b {
  color: var(--red);
}

.racing {
  color: var(--white);
  background: var(--black);
}

.racing .section-title p:last-child,
.racing .race-card p {
  color: #cfd3d8;
}

.race-card {
  color: var(--white);
  background: #151515;
  border-color: rgba(255, 255, 255, 0.13);
}

.culture {
  background: #f7f7f7;
}

.culture-card {
  min-height: 230px;
}

.culture-card .term {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 10px;
  color: var(--white);
  background: var(--black);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  font-weight: 950;
}

.buyer {
  background: var(--white);
}

.buyer-form {
  display: grid;
  gap: 18px;
}

.question-group {
  display: grid;
  gap: 9px;
}

.question-group legend {
  margin-bottom: 8px;
  font-weight: 950;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-panel {
  position: sticky;
  top: 92px;
}

.result-panel .model-name {
  color: var(--red);
}

.final-quiz {
  background: linear-gradient(180deg, #f1f2f3, #ffffff);
}

.flash-card {
  min-height: 360px;
}

.flash-card h3 {
  font-size: clamp(1.8rem, 3.2vw, 3.2rem);
  line-height: 1.02;
}

#flashAnswer {
  display: none;
  color: #5e6269;
  line-height: 1.6;
}

.flash-card.revealed #flashAnswer {
  display: block;
}

.knowledge-panel {
  display: grid;
  gap: 14px;
}

.quiz-question {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quiz-question h3 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.answer-button.correct {
  color: var(--white);
  background: #0f7a3b;
}

.answer-button.incorrect {
  color: var(--white);
  background: var(--red);
}

.score-box {
  padding: 16px;
  color: var(--white);
  background: var(--black);
  border-radius: var(--radius);
  font-weight: 950;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 4vw, 56px);
  color: var(--silver);
  background: var(--black);
}

footer strong {
  color: var(--white);
}

@media (max-width: 1120px) {
  .hero,
  .timeline-wrap,
  .family-layout,
  .quiz-layout,
  .engine-layout {
    grid-template-columns: 1fr;
  }

  .hero-content,
  .anchor-strip {
    padding-bottom: 5vh;
  }

  .intro-grid,
  .card-grid,
  .trim-board,
  .culture-grid,
  .race-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding-top: 8vh;
  }

  h1 {
    font-size: clamp(3.4rem, 20vw, 5.6rem);
  }

  .section-title,
  .intro-grid,
  .card-grid,
  .generation-grid,
  .trim-board,
  .culture-grid,
  .race-strip,
  .family-tree,
  .choice-row,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .timeline-button {
    grid-template-columns: 70px 1fr;
  }

  .engine-visual {
    min-height: 320px;
  }

  .visual-cue,
  .color-strip {
    grid-template-columns: 1fr;
  }
}
