:root {
  --paper: #f4f0e7;
  --paper-deep: #ece5d7;
  --card: #fbf8f1;
  --ink: #292722;
  --muted: #686155;
  --line: #d8cfbd;
  --line-strong: #b8aa8b;
  --gold: #8b7435;
  --gold-soft: #e9ddbd;
  --brown: #57472a;
  --dark: #24231f;
  --white: #fffdf8;
  --success: #406447;
  --danger: #7a4238;
  --shadow: 0 18px 50px rgba(56, 46, 28, 0.08);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(173, 145, 72, 0.10), transparent 25rem),
    var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.58;
}

button, input, textarea, select { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--dark);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(1100px, calc(100% - 40px));
  min-height: 104px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: 180px;
  height: 80px;
  object-fit: contain;
  object-position: left center;
}

.back-site {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.back-site:hover { text-decoration: underline; }

main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.landing { padding: 76px 0 88px; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.75fr);
  gap: clamp(36px, 8vw, 96px);
  align-items: end;
  margin-bottom: 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
}

h1 {
  max-width: 750px;
  font-size: clamp(2.45rem, 6vw, 4.9rem);
  letter-spacing: -0.035em;
}

.intro-note {
  margin: 0;
  padding: 8px 0 8px 24px;
  border-left: 1px solid var(--gold);
  color: var(--muted);
  font-size: 1.05rem;
}

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

.test-card {
  min-height: 290px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 248, 241, 0.84);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.test-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.test-card.featured {
  grid-column: 1 / -1;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr);
  column-gap: 48px;
  align-items: end;
  color: var(--white);
  border-color: var(--dark);
  background: var(--dark);
}

.test-card.featured .card-copy { max-width: 680px; }
.test-card.featured .card-kicker,
.test-card.featured .card-meta { color: #d7c89f; }
.test-card.featured p { color: #e8e2d6; }

.card-number {
  width: 42px;
  height: 42px;
  margin-bottom: 34px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 0.84rem;
  opacity: .72;
}

.card-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.test-card h2 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.7rem);
}

.test-card:not(.featured) h2 { font-size: clamp(1.55rem, 2.5vw, 2.1rem); }

.test-card p {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--muted);
}

.card-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.test-card.featured .card-bottom {
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}

.card-meta {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.btn {
  min-height: 48px;
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--dark);
  border-radius: 7px;
  color: var(--white);
  background: var(--dark);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .scale-option:focus-visible, .chip:focus-visible {
  outline: 3px solid rgba(139, 116, 53, .35);
  outline-offset: 3px;
}

.btn-light {
  color: var(--dark);
  border-color: var(--white);
  background: var(--white);
}

.btn-outline {
  color: var(--dark);
  border-color: var(--line-strong);
  background: transparent;
}

.btn-subtle {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.ethics-note {
  margin-top: 30px;
  padding: 18px 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: .86rem;
}

.ethics-note strong { color: var(--ink); }

.method-notes {
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.method-notes summary {
  padding: 17px 0;
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}

.method-notes details > div {
  max-width: 780px;
  padding: 0 0 22px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .86rem;
}

.method-notes p { margin: 0 0 10px; }
.method-notes a { color: var(--brown); font-weight: 700; }

.test-shell {
  width: min(830px, 100%);
  margin: 0 auto;
  padding: 48px 0 90px;
}

.test-topbar {
  margin-bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.home-link {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}

.home-link:hover { color: var(--ink); text-decoration: underline; }

.progress-copy {
  color: var(--muted);
  font-family: var(--sans);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  margin-bottom: 38px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 220ms ease;
}

.test-heading { margin-bottom: 30px; }
.test-heading h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}
.test-heading p { margin: 0; color: var(--muted); }

.question-card {
  min-height: 400px;
  padding: clamp(26px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.question-number {
  margin: 0 0 20px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.question-text {
  max-width: 700px;
  margin: 0;
  font-size: clamp(1.65rem, 3.8vw, 2.45rem);
  line-height: 1.22;
}

.scale-wrap { margin-top: 46px; }

.scale-labels {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .75rem;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.scale-option {
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}

.scale-option:hover,
.scale-option.selected {
  color: var(--white);
  border-color: var(--dark);
  background: var(--dark);
}

.question-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
}

.result-shell { padding-top: 54px; }

.result-hero {
  margin-bottom: 34px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.result-hero h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
}

.result-hero p {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
}

.result-bars {
  display: grid;
  gap: 19px;
}

.result-row {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(251, 248, 241, .7);
}

.result-row-head {
  margin-bottom: 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.result-row h2 { font-size: 1.35rem; }
.result-value {
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brown), #a88c43);
}

.result-row p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.result-callout {
  margin-top: 30px;
  padding: 24px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
}

.result-callout h2 { margin-bottom: 8px; font-size: 1.4rem; }
.result-callout p { margin: 0; }

.result-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.animal-result {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 30px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.animal-mark {
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brown);
  background: var(--gold-soft);
  font-size: 3.2rem;
}

.animal-result h2 { margin-bottom: 9px; font-size: 2rem; }
.animal-result p { margin: 0; color: var(--muted); }

.johari-intro,
.johari-result {
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.johari-intro h2 { margin-bottom: 10px; font-size: 1.75rem; }
.johari-intro p { color: var(--muted); }

.chip-counter {
  position: sticky;
  top: 10px;
  z-index: 3;
  width: fit-content;
  margin: 20px 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(244, 240, 231, .94);
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-family: var(--sans);
  font-size: .88rem;
  cursor: pointer;
}

.chip.selected {
  color: var(--white);
  border-color: var(--dark);
  background: var(--dark);
}

.johari-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.johari-cell {
  min-height: 180px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.johari-cell h2 { margin-bottom: 10px; font-size: 1.35rem; }
.johari-cell p { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.word-list { margin: 0; font-family: var(--sans); font-size: .9rem; }

.share-box {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
}

.share-box label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
}

.share-row { display: flex; gap: 10px; }
.share-row input {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
  font-family: var(--sans);
  font-size: .82rem;
}

.notice {
  margin: 18px 0 0;
  color: var(--success);
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 700;
}

.site-footer {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: .78rem;
}

.site-footer p { margin: 0; }

.error-box {
  margin: 50px auto;
  padding: 24px;
  border: 1px solid #c98c82;
  border-radius: 12px;
  background: #f8e8e4;
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header, main, .site-footer { width: min(100% - 32px, 1100px); }
  .site-header { min-height: 86px; }
  .brand img { width: 140px; height: 62px; }
  .back-site { font-size: .78rem; }
  .landing { padding: 48px 0 64px; }
  .intro { grid-template-columns: 1fr; gap: 28px; margin-bottom: 38px; }
  .intro-note { max-width: 38rem; }
  .test-grid { grid-template-columns: 1fr; }
  .test-card,
  .test-card.featured {
    grid-column: auto;
    min-height: 0;
    padding: 24px;
    display: flex;
  }
  .card-number { margin-bottom: 22px; }
  .test-card.featured .card-bottom { height: auto; margin-top: 18px; }
  .card-bottom { align-items: flex-end; }
  .test-shell { padding: 34px 0 64px; }
  .question-card { min-height: 430px; padding: 25px 20px; }
  .scale-grid { gap: 6px; }
  .scale-option { min-height: 54px; }
  .scale-labels { font-size: .7rem; }
  .result-row { padding: 18px; }
  .animal-result { grid-template-columns: 1fr; gap: 18px; }
  .animal-mark { width: 82px; height: 82px; font-size: 2.4rem; }
  .johari-grid { grid-template-columns: 1fr; }
  .share-row { flex-direction: column; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
