@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Lora:wght@400;500&display=swap");

:root {
  --ink: #1a1c18;
  --paper: #f8f7f2;
  --panel: #eeeee7;
  --white: #fffefa;
  --muted: #696c64;
  --line: #d9d9d0;
  --accent: #647b54;
  --accent-pale: #e3eadc;
  --warn: #a45c3e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid #91a981;
  outline-offset: 3px;
}

a {
  color: inherit;
}

.site-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-header > a:last-child {
  justify-self: end;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.logo {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.logo span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font:
    500 13px "Lora",
    serif;
}

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

.intro {
  display: grid;
  grid-template-columns: 1.5fr 0.5fr;
  gap: 64px;
  align-items: end;
  padding: clamp(72px, 10vw, 136px) 0 64px;
}

.intro .eyebrow {
  grid-column: 1 / -1;
}

.intro h1 {
  margin: 0;
  font:
    400 clamp(52px, 8vw, 100px)/0.96 "Lora",
    serif;
  letter-spacing: -0.045em;
}

.intro > p:last-child {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lab {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 760px;
  border: 1px solid var(--line);
  background: var(--white);
}

.controls {
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.panel-title,
.preview-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.panel-title button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

fieldset {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 24px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

legend {
  width: 100%;
  padding: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.input-money,
.input-suffix {
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.input-money b,
.input-suffix b {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 400;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.input-money input,
.input-suffix input {
  border: 0;
  background: transparent;
}

.toggle-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-row span {
  display: grid;
}

.toggle-row b {
  color: var(--ink);
  font-size: 13px;
}

.toggle-row small {
  font-size: 11px;
}

input[role="switch"] {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  appearance: none;
  border: 1px solid #aaa;
  border-radius: 20px;
  background: #ccc;
  cursor: pointer;
}

input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 180ms ease;
}

input[role="switch"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

input[role="switch"]:checked::after {
  transform: translateX(20px);
}

.update-button {
  min-height: 48px;
  margin: 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.preview {
  min-width: 0;
  background: #e7e5dd;
}

.preview-bar {
  background: var(--white);
}

.view-switch {
  display: flex;
  padding: 3px;
  border-radius: 7px;
  background: var(--panel);
}

.view-switch button {
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.view-switch button.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px #00000018;
}

.device-wrap {
  min-height: 704px;
  display: grid;
  place-items: center;
  padding: 40px;
  overflow: hidden;
}

.storefront {
  width: min(760px, 100%);
  border: 1px solid #cbc7bb;
  background: #faf7ef;
  box-shadow: 0 18px 40px #292d2520;
  transition: width 200ms ease;
}

.storefront.phone {
  width: min(390px, 100%);
}

.store-nav {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid #d8d2c4;
  font-family: "Lora", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product-art {
  min-height: 400px;
  display: grid;
  place-items: center;
  background: #c7cfbe;
}

.product-art span {
  width: 45%;
  height: 60%;
  border: 1px solid #727c67;
  border-radius: 48% 48% 12px 12px;
  background: #ebe5d8;
  box-shadow: inset 0 0 0 12px #ded6c6;
}

.product-info {
  padding: 40px 28px;
}

.product-type {
  margin: 0 0 14px;
  color: #67705f;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-info h2 {
  margin: 0 0 8px;
  font:
    400 34px/1.1 "Lora",
    serif;
}

.price {
  margin: 0 0 24px;
  font-weight: 600;
}

.description {
  color: var(--muted);
  font:
    400 14px/1.6 "Lora",
    serif;
}

.early-cost {
  min-height: 64px;
  margin: 20px 0;
  padding: 12px;
  border: 1px solid #d8d2c4;
  font-size: 12px;
}

.early-cost strong,
.early-cost span {
  display: block;
}

.early-cost span {
  color: var(--muted);
}

.add-button,
.checkout-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: #273023;
  color: white;
  cursor: pointer;
}

.cart-drawer {
  padding: 20px;
  border-top: 1px solid #d8d2c4;
  background: var(--white);
}

.cart-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-title h3 {
  margin: 0;
  font:
    400 22px "Lora",
    serif;
}

.cart-title span {
  color: var(--muted);
  font-size: 12px;
}

.cart-drawer dl {
  margin: 16px 0;
}

.cart-drawer dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.cart-drawer dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.cart-drawer .total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}

.storefront.phone .product {
  grid-template-columns: 1fr;
}

.storefront.phone .product-art {
  min-height: 220px;
}

.storefront.phone .product-info {
  padding: 24px 20px;
}

.diagnosis {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 64px;
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}

.score-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
}

.score-card .eyebrow {
  color: #e4ecdf;
}

.score-card strong {
  font:
    400 clamp(64px, 8vw, 96px)/1 "Lora",
    serif;
  font-variant-numeric: tabular-nums;
}

.score-card span {
  font-size: 13px;
}

.diagnosis-copy h2 {
  margin: 0 0 24px;
  font:
    400 44px "Lora",
    serif;
}

.copy-box {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.copy-box p {
  margin: 0 0 20px;
  font:
    400 20px/1.5 "Lora",
    serif;
}

.copy-box button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

#recommendation {
  color: var(--muted);
}

.origin {
  display: grid;
  grid-template-columns: 0.5fr 1fr 1fr;
  gap: 48px;
  padding: 96px 0;
}

.origin h2 {
  margin: 0;
  font:
    400 clamp(32px, 4vw, 48px)/1.15 "Lora",
    serif;
}

.origin > div {
  color: var(--muted);
}

.origin a {
  color: var(--accent);
}

footer {
  padding: 28px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer p {
  margin: 0;
}

@media (max-width: 940px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .lab {
    grid-template-columns: 1fr;
  }
  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #clarity-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  fieldset {
    border-right: 1px solid var(--line);
  }
  fieldset:last-child {
    border-right: 0;
  }
  .update-button {
    grid-column: 1 / -1;
  }
  .origin {
    grid-template-columns: 0.5fr 1fr;
  }
  .origin > div {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .site-header p {
    display: none;
  }
  main {
    width: min(100% - 24px, 1280px);
  }
  .intro {
    padding-top: 56px;
  }
  .intro h1 {
    font-size: 48px;
  }
  #clarity-form {
    grid-template-columns: 1fr;
  }
  fieldset {
    border-right: 0;
  }
  .view-switch button {
    min-width: 44px;
    font-size: 0;
  }
  .view-switch button::first-letter {
    font-size: 13px;
  }
  .device-wrap {
    min-height: 0;
    padding: 16px;
  }
  .storefront .product {
    grid-template-columns: 1fr;
  }
  .product-art {
    min-height: 220px;
  }
  .product-info {
    padding: 24px 20px;
  }
  .diagnosis {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 72px 0;
  }
  .origin {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 72px 0;
  }
  .origin > div {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storefront,
  input[role="switch"]::after {
    transition: none;
  }
}

.view-switch button {
  min-height: 44px;
}

footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
