
:root {
  --brain-red: #7f0905;
  --brain-red-dark: #4f0503;
  --brain-red-light: #a61c15;
  --brain-yellow: #fff200;
  --brain-gold: #f4df72;
  --cream: #fffbea;
  --ink: #2e1916;
  --muted: #6e5650;
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(79, 5, 3, 0.16);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(255, 242, 0, 0.12), transparent 28%),
    linear-gradient(180deg, #fffdf4 0%, #fff8df 100%);
}

button, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background: var(--brain-red-dark);
  border-bottom: 5px solid var(--brain-yellow);
}

.brain-banner {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  display: block;
  background: var(--brain-red-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 50px;
}

.hero {
  display: grid;
  grid-template-columns: 1.55fr 0.75fr;
  gap: 24px;
  align-items: stretch;
}

.hero-content,
.notice,
.recommendation-panel,
.source-note {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-content {
  padding: 42px;
  background: linear-gradient(135deg, var(--brain-red) 0%, var(--brain-red-dark) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero-content::after {
  content: "";
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 242, 0, 0.12);
  position: absolute;
  right: -55px;
  bottom: -70px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brain-yellow);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.02;
}

.hero-text {
  max-width: 780px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: #fff8d0;
}

.hero-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.small-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-btn {
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  box-shadow: 0 8px 20px rgba(255, 242, 0, .22);
}

.secondary-btn {
  background: transparent;
  color: inherit;
  border: 2px solid currentColor;
}

.hero .secondary-btn {
  color: var(--brain-gold);
}

.primary-btn:hover,
.secondary-btn:hover,
.small-btn:hover,
.technique-card:hover,
.state-btn:hover {
  transform: translateY(-2px);
}

.notice {
  padding: 28px;
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  border: 3px solid var(--brain-red-dark);
}

.notice h2 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.notice p {
  line-height: 1.65;
}

.recommendation-panel {
  margin-top: 24px;
  padding: 28px;
  background: var(--white);
  border: 2px solid var(--brain-gold);
}

.panel-heading,
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.icon-btn,
.modal-close {
  border: none;
  background: var(--brain-red);
  color: var(--brain-yellow);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}

.state-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.state-btn {
  border: 2px solid #e7c765;
  background: var(--cream);
  color: var(--brain-red-dark);
  border-radius: 15px;
  padding: 16px;
  font-weight: 750;
  text-align: left;
}

.state-result {
  margin-top: 20px;
  border-left: 5px solid var(--brain-red);
  background: #fff8d8;
  padding: 18px 20px;
  border-radius: 12px;
}

.toolbar {
  margin: 42px 0 20px;
}

.toolbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--brain-red-dark);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-btn {
  border: 1px solid #cda934;
  background: var(--white);
  color: var(--brain-red-dark);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
}

.filter-btn.active {
  background: var(--brain-red);
  color: var(--brain-yellow);
  border-color: var(--brain-red);
}

.technique-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.technique-card {
  background: var(--white);
  border: 1px solid #ecd989;
  border-top: 6px solid var(--brain-red);
  border-radius: 18px;
  padding: 23px;
  box-shadow: 0 10px 26px rgba(79, 5, 3, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  min-height: 285px;
}

.technique-card:hover {
  box-shadow: var(--shadow);
}

.technique-card h3 {
  margin: 12px 0 8px;
  color: var(--brain-red-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.technique-card p {
  color: var(--muted);
  line-height: 1.55;
  flex-grow: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.category-tag,
.category-pill,
.duration-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 800;
  font-size: .76rem;
}

.category-tag,
.category-pill {
  background: #fff4a3;
  color: var(--brain-red-dark);
  padding: 7px 10px;
}

.duration {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.card-btn {
  width: 100%;
  border: none;
  background: var(--brain-red);
  color: var(--brain-yellow);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 850;
}

.source-note {
  margin-top: 38px;
  padding: 28px;
  background: #fff8d3;
  border-left: 8px solid var(--brain-red);
}

.source-note h2 {
  margin-top: 0;
  color: var(--brain-red-dark);
}

.source-note p {
  line-height: 1.65;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 3, 2, 0.76);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  padding: 34px;
  border-top: 8px solid var(--brain-yellow);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
}

.modal-meta {
  display: flex;
  gap: 8px;
  padding-right: 52px;
}

.duration-pill {
  background: #f3ece9;
  color: var(--muted);
  padding: 7px 10px;
}

.modal-card h2 {
  margin: 16px 0 8px;
  color: var(--brain-red-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.modal-purpose {
  line-height: 1.6;
  color: var(--muted);
}

.progress-wrap {
  height: 8px;
  background: #eee3df;
  border-radius: 99px;
  overflow: hidden;
  margin: 22px 0;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brain-red), var(--brain-yellow));
  transition: width .25s ease;
}

.step-container {
  background: var(--cream);
  border: 2px solid #efd36c;
  border-radius: 18px;
  padding: 24px;
  min-height: 190px;
}

.step-number {
  margin: 0 0 8px;
  color: var(--brain-red);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.step-container h3 {
  margin: 0 0 10px;
  color: var(--brain-red-dark);
}

.step-container p,
.step-container li {
  line-height: 1.65;
}

.guided-phrase {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  color: var(--brain-red-dark);
  background: #fff;
  border-left: 5px solid var(--brain-yellow);
  border-radius: 10px;
  padding: 14px 16px;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 14px;
  background: #f5ede8;
}

#timerDisplay {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brain-red-dark);
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.small-btn {
  padding: 9px 13px;
  background: var(--brain-red);
  color: var(--brain-yellow);
}

.small-btn.ghost {
  background: transparent;
  color: var(--brain-red);
  border: 1px solid var(--brain-red);
}

.modal-actions {
  margin-top: 20px;
  justify-content: space-between;
}

.modal-actions .secondary-btn {
  color: var(--brain-red);
}

.completion-box {
  margin-top: 22px;
  padding: 22px;
  border-radius: 16px;
  background: #fff8c7;
  border: 2px solid var(--brain-yellow);
}

.completion-box label {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  font-weight: 700;
}

.completion-box select {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #b5942b;
  background: white;
}

.saved-message {
  color: #416b20;
  font-weight: 800;
}

footer {
  padding: 24px;
  text-align: center;
  background: var(--brain-red-dark);
  color: var(--brain-gold);
  border-top: 4px solid var(--brain-yellow);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

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

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero-content,
  .notice,
  .recommendation-panel,
  .modal-card {
    padding: 22px;
  }

  .technique-grid,
  .state-grid {
    grid-template-columns: 1fr;
  }

  .brain-banner {
    min-height: 105px;
    object-fit: cover;
    object-position: center;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }
}


.category-explanation {
  margin: 0 0 20px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #fff7b5 0%, #fffdf0 100%);
  border: 2px solid #e2bd38;
  border-left: 8px solid var(--brain-red);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(79, 5, 3, 0.08);
}

.category-explanation h3 {
  margin: 0 0 8px;
  color: var(--brain-red-dark);
  font-family: Georgia, "Times New Roman", serif;
}

.category-explanation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal-category-help {
  margin: 16px 0 14px;
  padding: 16px 18px;
  background: #fff8c9;
  border-left: 6px solid var(--brain-red);
  border-radius: 12px;
  color: var(--brain-red-dark);
  line-height: 1.6;
}

.modal-purpose::before {
  content: "How this technique may help";
  display: block;
  margin-bottom: 6px;
  color: var(--brain-red-dark);
  font-weight: 900;
}
