/* ===== Lubiwood — Which Puzzle Are You? ===== */

:root {
  --walnut:    #2c2218;
  --walnut-2:  #3d2f22;
  --wood:      #8b6440;
  --amber:     #c89968;
  --amber-2:   #b07e4c;
  --cream-bg:  #f5ecd9;
  --cream:     #faf3e1;
  --paper:     #fbf6e8;
  --paper-2:   #f0e5c8;
  --ink:       #2a221b;
  --ink-soft:  #6f5e4c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ece2c8;
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1400px 700px at 50% -120px, rgba(200,153,104,0.22), transparent 60%),
    #ece2c8;
  min-height: 100vh;
  padding: 30px 16px 80px;
}

/* ===== Layout shell ===== */

.email {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow:
    0 30px 80px -20px rgba(44,34,24,0.32),
    0 8px 22px -10px rgba(44,34,24,0.18);
  position: relative;
  overflow: hidden;
}
.email::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(184,133,74,0.22);
  pointer-events: none;
  z-index: 0;
}
.email::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0,0,0,0.022) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}
.email > * { position: relative; z-index: 2; }

/* ===== Type helpers ===== */

.serif        { font-family: 'Cormorant Garamond', serif; }
.serif-italic { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; }
.serif-sc     { font-family: 'Cormorant SC', serif; letter-spacing: 0.08em; }

/* ===== Banner ===== */

.banner {
  background: linear-gradient(180deg, #2c2218 0%, #3a2c1e 100%);
  color: var(--cream);
  padding: 36px 28px 32px;
  position: relative;
  border-bottom: 3px solid var(--amber);
}
.banner .corner {
  position: absolute;
  color: var(--amber);
  opacity: 0.85;
  font-size: 14px;
  font-family: 'Cormorant SC', serif;
}
.banner .corner.tl { top: 14px; left: 16px; }
.banner .corner.tr { top: 14px; right: 16px; }
.banner .corner.bl { bottom: 14px; left: 16px; }
.banner .corner.br { bottom: 14px; right: 16px; }

.banner__strip {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-align: center;
  opacity: 0.85;
  margin-bottom: 14px;
  color: var(--amber);
}
.banner__row {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  gap: 16px;
}
.banner__img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
}
.banner__img.left  { transform: rotate(-8deg); }
.banner__img.right { transform: rotate(8deg);  }
.banner__center { text-align: center; }
.banner__title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 36px;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--cream);
  font-family: 'Cormorant SC', serif;
}
.banner__title em {
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: normal;
  color: var(--amber);
  font-family: 'Cormorant Garamond', serif;
}
.banner__tag {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  margin-bottom: 14px;
  color: #e8d8b3;
}
.banner__begin {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--amber);
}

/* ===== Diamond / Circle nodes ===== */

.diamond {
  margin: 0 auto;
  transform: rotate(45deg);
  background: var(--walnut);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -14px rgba(44,34,24,0.5);
}
.diamond__inner {
  transform: rotate(-45deg);
  color: var(--cream);
  text-align: center;
  padding: 10px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.diamond__inner--inverse {
  color: rgba(255, 255, 255, 0.96);
}
.diamond__inner--inverse .sub {
  color: rgba(255, 255, 255, 0.92);
}
.diamond .label {
  font-family: 'Cormorant SC', serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--amber);
}
.diamond__inner--inverse .label.diamond-stack {
  color: #fff;
  letter-spacing: 0.06em;
}
/* Two-line stacks (TI/SI, YOU/ARE, …) — stable box for any locale */
.diamond-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 2.75em;
  padding: 1px 4px 3px;
  margin: 0 auto;
  max-width: 12em;
  box-sizing: border-box;
}
.diamond-stack--single {
  min-height: 1.35em;
  padding-top: 0;
  padding-bottom: 0;
}
.diamond-stack__line {
  display: block;
  line-height: 1.12;
}
.diamond__orn {
  font-family: 'Cormorant SC', serif;
  font-size: 14px;
  opacity: 0.95;
  color: var(--amber);
  line-height: 1;
}
.diamond__orn--inverse {
  color: rgba(255, 255, 255, 0.95);
}
.diamond .sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15px;
  opacity: 0.95;
}

.start-node { padding: 40px 0 8px; }

.circle {
  border-radius: 50%;
  background: var(--paper-2);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -14px rgba(44,34,24,0.25);
  transition: background .4s ease;
}
.circle__inner {
  text-align: center;
  padding: 18px;
  line-height: 1.15;
}

/* ===== Dotted connectors ===== */

.dotted, .divider {
  display: block;
  margin: 0 auto;
}

/* ===== Tally ===== */

.tally { padding: 20px 24px 0; }
.tally__heading {
  text-align: center;
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--ink-soft);
}
.tally__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 380px;
  margin: 10px auto 0;
}
.tally__cell {
  text-align: center;
  padding: 10px 4px 8px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed rgba(44,34,24,0.2);
  transition: background .3s ease;
}
.tally__cell.active {
  background: var(--amber);
  color: #fff;
  border-color: transparent;
}
.tally__cell .ltr {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.6;
}
.tally__cell.active .ltr { opacity: 1; }
.tally__cell .count {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  opacity: 0.45;
}
.tally__cell.active .count { opacity: 1; }

/* ===== Question block ===== */

.question {
  padding: 8px 24px 0;
  opacity: 0.18;
  filter: blur(1px);
  pointer-events: none;
  transition: opacity .6s ease, transform .6s ease, filter .4s ease;
  transform: translateY(14px);
}
.question.visible {
  opacity: 1;
  filter: none;
  pointer-events: auto;
  transform: translateY(0);
}

.question__prompt {
  font-family: 'Cormorant SC', serif;
  font-size: 17px;
  letter-spacing: 0.12em;
  line-height: 1.25;
  color: var(--ink);
}
.question__num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 540px;
  margin: 0 auto;
}

/* ===== Answer pills ===== */

.pill {
  appearance: none;
  border: 0;
  background: var(--paper-2);
  color: var(--ink);
  padding: 14px 12px 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform .25s, background .25s, color .25s, box-shadow .25s, opacity .3s;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.pill:hover:not(:disabled) {
  background: #e9dbb6;
  transform: translateY(-1px);
}
.pill.selected {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(176,126,76,0.55);
}
.pill.dim { opacity: 0.5; }
.pill:disabled { cursor: default; }

.pill__ltr {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
}
.pill.selected .pill__ltr { color: rgba(255,255,255,0.85); }

.pill__text {
  font-size: 14px;
  line-height: 1.2;
  min-height: 34px;
}
.pill__emoji {
  font-size: 18px;
  margin-top: 6px;
}

/* ===== Result block ===== */

.result { padding: 8px 24px 60px; }

.result__hero {
  padding: 32px 24px 24px;
  position: relative;
  margin-top: 6px;
  transition: background .4s ease;
}
.result__hero .sparkle {
  position: absolute;
  font-family: 'Cormorant SC', serif;
  opacity: 0.7;
}
.result__photo-wrap { text-align: center; }
.result__photo {
  max-width: 70%;
  max-height: 360px;
  filter: drop-shadow(0 22px 26px rgba(0,0,0,0.22));
  display: inline-block;
}

.result__label {
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.36em;
  opacity: 0.7;
}
.result__title {
  margin: 8px 0 4px;
  font-family: 'Cormorant SC', serif;
  font-size: 60px;
  letter-spacing: 0.04em;
  font-weight: 700;
  line-height: 1;
}
.result__tagline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
}

.result__body {
  background: var(--paper);
  padding: 26px 24px 30px;
  text-align: center;
}
.result__blurb {
  max-width: 460px;
  margin: 10px auto 18px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
}

.traits {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 auto 22px;
}
.trait {
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 8px 12px;
  background: rgba(255,255,255,0.5);
}

.why {
  background: var(--paper-2);
  padding: 18px 22px;
  max-width: 520px;
  margin: 0 auto 22px;
}
.why__label {
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  margin-bottom: 6px;
}
.why__text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

.product-card {
  background: #fff;
  padding: 16px;
  max-width: 460px;
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: 0 6px 18px -12px rgba(0,0,0,0.18);
}
.product-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
.product-card__sku {
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.product-card__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
}
.product-card__sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.product-card__price {
  font-family: 'Cormorant SC', serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.cta {
  display: inline-block;
  color: #fff;
  padding: 16px 32px;
  font-family: 'Cormorant SC', serif;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-decoration: none;
}

.secondary {
  margin-top: 22px;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.secondary a, .secondary button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-style: dotted;
}

.gift {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--walnut);
  color: var(--cream);
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.gift__label {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--amber);
  margin-bottom: 6px;
}
.gift__text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
}
.gift__code {
  background: var(--amber);
  color: var(--walnut);
  padding: 2px 10px;
  letter-spacing: 0.18em;
  font-family: 'Cormorant SC', serif;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Footer ===== */

.footer {
  background: var(--walnut);
  color: var(--cream);
  padding: 34px 24px 28px;
  text-align: center;
  border-top: 3px solid var(--amber);
}
.footer__brand {
  font-family: 'Cormorant SC', serif;
  font-size: 16px;
  letter-spacing: 0.42em;
  color: var(--amber);
}
.footer__sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: #e8d8b3;
  margin: 6px 0 16px;
  opacity: 0.9;
}
.footer__links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer__links a {
  color: var(--cream);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dotted rgba(245,236,217,0.4);
  padding-bottom: 1px;
  opacity: 0.9;
}
.footer__fineprint {
  font-family: 'Cormorant SC', serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #bfaa82;
  opacity: 0.8;
}
.footer__fineprint a { color: inherit; }

/* ===== Animations ===== */

@keyframes float {
  0%,100% { transform: translateY(0) rotate(0); }
  50%     { transform: translateY(-8px) rotate(-1deg); }
}
.float { animation: float 5s ease-in-out infinite; }

@keyframes sparkle {
  0%,100% { opacity: 0.4; transform: scale(0.9); }
  50%     { opacity: 1;   transform: scale(1.1); }
}
.twinkle { animation: sparkle 3s ease-in-out infinite; }

/* ===== Mobile ===== */

/* ===== Language Picker ===== */

.lang-picker {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

[dir="rtl"] .lang-picker {
  right: auto;
  left: 16px;
}

.lang-picker__label {
  font-size: 15px;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.lang-picker__select {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--amber-2);
  border-radius: 4px;
  padding: 3px 22px 3px 7px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23b07e4c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 8px 5px;
  max-width: 120px;
}

.lang-picker__select:focus {
  outline: none;
  border-color: var(--amber);
}

/* RTL layout support */
[dir="rtl"] .answers { direction: rtl; }
[dir="rtl"] .pill    { text-align: right; flex-direction: row-reverse; }
[dir="rtl"] .tally__grid { direction: rtl; }
[dir="rtl"] .result__body { direction: rtl; text-align: right; }
[dir="rtl"] .why    { text-align: right; }
[dir="rtl"] .footer { direction: rtl; }

@media (max-width: 520px) {
  body { padding: 0; }
  .email { box-shadow: none; }
  .email::before { inset: 8px; }
  .banner { padding: 28px 18px 24px; }
  .banner__row { grid-template-columns: 64px 1fr 64px; gap: 10px; }
  .banner__img { width: 64px; height: 64px; }
  .banner__title { font-size: 26px; }
  .result__title { font-size: 44px; }
  .answers { gap: 8px; }
  .pill { padding: 12px 8px 10px; font-size: 14px; }
}
