@font-face {
  font-family: "KGBrokenVesselsSketch";
  src: url("fonts/KGBrokenVesselsSketch.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "ADNOC Sans Bold";
  src: url("fonts/ADNOC Sans Bold.ttf") format("truetype");
  font-weight: 400;
}

:root {
  --font-title: "KGBrokenVesselsSketch", "Segoe UI Rounded", sans-serif;
  --font-body: "ADNOC Sans Bold", "Segoe UI", sans-serif;

  --cream: #f4e9dc;
  --cream-deep: #eadfcc;
  --terracotta: #c66442;
  --terracotta-dark: #a94f35;
  --olive: #969267;
  --navy: #0047ba;
  --navy-deep: #143661;
  --white: #ffffff;
  --ink: #3b3226;
  --correct: #4c8b5b;
  --incorrect: #c9432f;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
}

.squiggle {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}
.squiggle.tl {
  top: -2px;
  left: -2px;
  width: 250px;
}
.squiggle.br {
  bottom: -2px;
  right: -2px;
  width: 300px;
}
@media (max-width: 600px) {
  .squiggle.tl {
    width: 100px;
  }
  .squiggle.br {
    width: 130px;
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px 40px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.brand-header .divider {
  width: 1px;
  height: 60px;
  background: rgba(59, 50, 38, 0.25);
}

.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  height: 110px;
  font-size: 11px;
  padding: 6px;
}
.logo-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.screen {
  display: none;
  flex-direction: column;
}
.screen.active {
  display: flex;
}
.fade-in {
  animation: fadeIn 0.5s ease both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#welcome {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 22px;
}
.eyebrow {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--olive);
}
h1.title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 44px;
  line-height: 1.05;
  margin: 6px 0 0;
  color: var(--terracotta);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}
h1.title span {
  color: var(--navy);
  display: block;
  font-size: 0.55em;
  margin-top: 4px;
  letter-spacing: 1px;
}
.tagline {
  font-size: 17px;
  max-width: 440px;
  color: var(--ink);
  opacity: 0.85;
  margin: 4px 0 6px;
}

.btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 18px;
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  cursor: pointer;
  color: var(--white);
  background: var(--terracotta);
  box-shadow: 0 6px 0 var(--terracotta-dark);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.btn:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--terracotta-dark);
}
.btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--terracotta-dark);
}
.btn.secondary {
  background: var(--navy);
  box-shadow: 0 6px 0 var(--navy-deep);
}
.btn.secondary:hover {
  box-shadow: 0 4px 0 var(--navy-deep);
}
.btn.secondary:active {
  box-shadow: 0 0 0 var(--navy-deep);
}
.btn:disabled {
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  background: #d8d0c2;
  color: #a89f8f;
}

.rig-progress {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 22px;
}
.rig-track {
  position: relative;
  height: 54px;
  border-radius: 14px;
  background: repeating-linear-gradient(
    90deg,
    #e4d6c1 0 40px,
    #dccbaf 40px 80px
  );
  border: 2px solid rgba(59, 50, 38, 0.15);
  overflow: hidden;
}
.rig-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--olive), var(--navy));
  width: 0%;
  transition: width 0.5s ease;
}
.rig-bit {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  font-size: 26px;
  transition: left 0.5s ease;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}
.rig-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  opacity: 0.75;
  margin-top: 6px;
}

#quiz {
  gap: 18px;
  justify-content: center;
}
.question-card {
  background: var(--white);
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: 0 10px 24px rgba(59, 50, 38, 0.1);
}
.q-number {
  font-family: var(--font-body);
  color: var(--olive);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.q-text {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 23px;
  color: var(--terracotta-dark);
  line-height: 1.3;
  margin: 0 0 20px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.option {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  text-align: left;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid rgba(30, 76, 140, 0.25);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}
.option .tag {
  font-family: var(--font-title);
  background: var(--navy);
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.option span:not(.tag) {
  margin-top: 5px;
}

.option:hover:not(.locked) {
  border-color: var(--navy);
  background: #efe2cc;
}
.option.correct {
  background: #e4f1e6;
  border-color: var(--correct);
  color: var(--correct);
}
.option.correct .tag {
  background: var(--correct);
}
.option.incorrect {
  background: #fbe7e3;
  border-color: var(--incorrect);
  color: var(--incorrect);
}
.option.incorrect .tag {
  background: var(--incorrect);
}
.option.locked {
  cursor: default;
}
.option.dimmed {
  opacity: 0.55;
}

.quiz-footer {
  display: flex;
  justify-content: flex-end;
}

#results {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 16px;
}
.core-sample {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(
    var(--terracotta) calc(var(--pct, 0) * 1%),
    #ccbda7 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(59, 50, 38, 0.15);
}
.core-sample .inner {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.core-sample .inner .score {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 26px;
  color: var(--terracotta-dark);
}
.core-sample .inner .of {
  font-size: 12px;
  opacity: 0.7;
}

h2.result-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 30px;
  color: var(--navy);
  margin: 0;
}
.result-msg {
  max-width: 420px;
  font-size: 16px;
  opacity: 0.85;
}

@media (max-width: 480px) {
  .app {
    padding: 16px 16px 24px;
  }
  .brand-header {
    margin-bottom: 12px;
  }
  .logo-slot {
    height: 70px;
    font-size: 10px;
  }
  h1.title {
    font-size: 32px;
  }
  .rig-progress {
    margin-bottom: 16px;
  }
  .rig-track {
    height: 46px;
  }
  #quiz {
    gap: 14px;
  }
  .question-card {
    padding: 20px 18px;
  }
  .q-text {
    font-size: 19px;
    margin-bottom: 14px;
  }
  .options {
    gap: 10px;
  }
  .option {
    padding: 12px 14px;
  }
  .btn {
    padding: 14px 30px;
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .squiggle.tl {
    width: 70px;
  }
  .squiggle.br {
    width: 90px;
  }
}

.textured-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.textured-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/bg.jpg") center/ cover no-repeat;
  opacity: 0.1;
  mix-blend-mode: multiply;
  pointer-events: none;
}
