/* brito.ai — design system
   A light/dark, serif-forward system inspired by the typographic, paper-clean
   look of theodore.net: Crimson Pro display, JetBrains Mono UI labels, Fira Sans
   body. Shared by the homepage and /store. */

/* ---------- tokens ---------- */
:root {
  --font-serif: "Crimson Pro", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Fira Sans", -apple-system, system-ui, Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.32s;

  /* light (default) */
  --bg: #ffffff;
  --fg: rgba(0, 0, 0, 0.87);
  --fg-muted: rgba(0, 0, 0, 0.56);
  --fg-faint: rgba(0, 0, 0, 0.32);
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.24);
  --card-bg: #fafafa;
  --field-bg: #ffffff;
  --accent: #111317;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.07);
  --success: #2f9e64;
  --danger: #d64545;
}

[data-theme="dark"] {
  --bg: #202126;
  --fg: rgba(255, 255, 255, 0.90);
  --fg-muted: rgba(255, 255, 255, 0.58);
  --fg-faint: rgba(255, 255, 255, 0.34);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --card-bg: #26282e;
  --field-bg: #25262b;
  --accent: #ffffff;
  --on-accent: #16171b;
  --header-bg: rgba(32, 33, 38, 0.82);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.40);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.30);
  --success: #58c98c;
  --danger: #ec6a6a;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: rgba(127, 90, 240, 0.22); }

.wrap { width: min(var(--maxw), 100% - 48px); margin-inline: auto; }

/* ---------- reveal (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(var(--maxw), 100% - 48px); margin-inline: auto;
  height: 68px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.brand-word {
  font-family: var(--font-mono); font-size: 15px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--fg);
}
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.icon-btn svg { width: 21px; height: 21px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 12vh, 140px) 0 clamp(40px, 7vh, 84px); }
.hero-title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(40px, 7.5vw, 76px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0; color: var(--fg);
}
.hero-title .typed-wrap { font-style: italic; font-weight: 400; }
.typed-cursor { font-style: normal; font-weight: 300; opacity: 0.55; }
.hero-sub {
  font-family: var(--font-mono); font-weight: 300; font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.6; color: var(--fg-muted); margin: 22px 0 0; max-width: 52ch;
}

/* ---------- section heading ---------- */
.section { padding: clamp(28px, 5vh, 56px) 0; }
.eyebrow {
  font-family: var(--font-mono); font-weight: 400; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-faint);
  margin: 0 0 14px;
}
.section-title {
  font-family: var(--font-serif); font-weight: 500; font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.01em; margin: 0 0 6px; color: var(--fg);
}
.page-title {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 6vw, 56px);
  letter-spacing: -0.015em; margin: 0; color: var(--fg);
}
.page-title b { font-weight: 600; }
.page-sub {
  font-family: var(--font-mono); font-weight: 300; font-size: 14px;
  color: var(--fg-muted); margin: 10px 0 0;
}

/* ---------- contact links ---------- */
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.04em; color: var(--fg);
  padding: 10px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: transparent;
  transition: border-color var(--dur) var(--ease), transform 0.18s var(--ease), background var(--dur) var(--ease);
}
.link-chip:hover { border-color: var(--fg); transform: translateY(-1px); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.link-chip svg { width: 16px; height: 16px; }

/* ---------- contact form ---------- */
.contact-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card-bg); padding: clamp(22px, 3.4vw, 38px);
  box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-faint);
}
.field input, .field textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--fg);
  background: var(--field-bg); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { resize: vertical; min-height: 116px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--fg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 9%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--fg-faint); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  appearance: none; cursor: pointer; border: 1px solid transparent;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  background: var(--accent); color: var(--on-accent);
  padding: 13px 22px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 9px;
  transition: transform 0.18s var(--ease), opacity var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-ghost {
  background: transparent; color: var(--fg); border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--fg); }
.form-msg {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
}
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: clamp(48px, 9vh, 110px);
  padding: 40px 0 56px;
}
.footer-inner {
  width: min(var(--maxw), 100% - 48px); margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.social { display: flex; gap: 8px; }
.social a {
  width: 40px; height: 40px; border-radius: 10px; color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.social a:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.social svg { width: 19px; height: 19px; }
.copyright { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); margin: 0; }
.footer-links { font-family: var(--font-mono); font-size: 12px; color: var(--fg-faint); margin: 0; display: flex; gap: 16px; }
.footer-links a { transition: color var(--dur) var(--ease); }
.footer-links a:hover { color: var(--fg); }

/* ===================================================================
   STORE
   =================================================================== */
.store-legal { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); line-height: 1.6; max-width: 70ch; }

.store-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: 38px;
}
.product-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pc-stretch { position: absolute; inset: 0; z-index: 1; }
.pc-imgwrap {
  aspect-ratio: 1 / 1; background: var(--card-bg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pc-img { width: 100%; height: 100%; object-fit: contain; padding: 12%; }
.pc-img.pc-ph { color: var(--fg-faint); }
.pc-img.pc-ph svg { width: 38%; height: 38%; }
.pc-body { position: relative; z-index: 2; padding: 18px 18px 20px; pointer-events: none; }
.pc-body .pc-add { pointer-events: auto; }
.pc-add {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 34px; height: 34px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform 0.18s var(--ease);
}
.pc-add:hover { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.pc-add svg { width: 17px; height: 17px; }
.pc-title { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; margin: 0 0 6px; color: var(--fg); }
.pc-desc { font-family: var(--font-sans); font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); margin: 0 0 12px; max-width: 32ch; }
.pc-price { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg); margin: 0; }
.pc-price .from { color: var(--fg-faint); margin-right: 6px; }

/* product detail */
.return-link { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-muted); display: inline-flex; gap: 8px; align-items: center; margin-bottom: 26px; transition: color var(--dur) var(--ease); }
.return-link:hover { color: var(--fg); }
.pd-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.pe-carousel { position: relative; }
.pe-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; background: var(--card-bg); }
.pe-slides { position: relative; width: 100%; height: 100%; }
.pe-slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur) var(--ease); display: flex; align-items: center; justify-content: center; }
.pe-slide.active { opacity: 1; }
.pe-slide img { width: 100%; height: 100%; object-fit: contain; padding: 11%; }
.pe-ph { color: var(--fg-faint); }
.pe-ph svg { width: 34%; height: 34%; }
.pe-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--header-bg); color: var(--fg);
  backdrop-filter: blur(6px); display: inline-flex; align-items: center; justify-content: center;
}
.pe-carousel.is-single .pe-arrow, .pe-carousel.is-single .pe-dots { display: none; }
.pe-arrow.prev { left: 12px; } .pe-arrow.next { right: 12px; }
.pe-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.pe-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--line-strong); transition: background var(--dur) var(--ease); }
.pe-dot.active { background: var(--fg); }

.pe-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.01em; margin: 0 0 10px; }
.pe-sub { font-family: var(--font-sans); font-size: 15.5px; line-height: 1.6; color: var(--fg-muted); margin: 0 0 24px; }
.opt-seg { position: relative; display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); margin-bottom: 18px; }
.opt-seg button { position: relative; z-index: 2; appearance: none; border: 0; background: transparent; cursor: pointer; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--fg-muted); padding: 8px 16px; border-radius: var(--radius-pill); transition: color var(--dur) var(--ease); }
.opt-seg button[aria-current="true"] { color: var(--on-accent); }
.opt-pill { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 0; border-radius: var(--radius-pill); background: var(--accent); transition: transform var(--dur) var(--ease), width var(--dur) var(--ease); }
.pe-variant-desc { font-family: var(--font-sans); font-size: 14px; line-height: 1.55; color: var(--fg-muted); margin: 0 0 20px; min-height: 1.2em; }
.pe-buyrow { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.pe-price { font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: var(--fg); }
.pe-qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 4px; }
.pe-qty button { appearance: none; border: 0; background: transparent; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; color: var(--fg); transition: background var(--dur) var(--ease); }
.pe-qty button:hover { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.pe-qty span { font-family: var(--font-mono); font-size: 14px; min-width: 22px; text-align: center; }
.pe-buy { width: 100%; justify-content: space-between; }
.pe-softnote { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-faint); line-height: 1.6; margin: 16px 0 0; }
.pe-details { border-top: 1px solid var(--line); }
.pe-details summary { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--fg); padding: 16px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.pe-details summary::after { content: "+"; color: var(--fg-faint); font-size: 16px; }
.pe-details[open] summary::after { content: "–"; }
.pe-details summary::-webkit-details-marker { display: none; }
.pe-contents-list { margin: 0 0 18px; padding-left: 18px; font-family: var(--font-sans); font-size: 14px; line-height: 1.7; color: var(--fg-muted); }
.pe-details-body { font-family: var(--font-sans); font-size: 14px; line-height: 1.65; color: var(--fg-muted); margin-bottom: 18px; }
.pe-details-body a, .pe-contents-list a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }

/* cart drawer */
.store-cart-btn { position: relative; }
.store-cart-count {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent);
  font-family: var(--font-mono); font-size: 10px; line-height: 16px; text-align: center;
  opacity: 0; transform: scale(0.5); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.store-cart-btn.has-items .store-cart-count { opacity: 1; transform: scale(1); }
.cart-scrim {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.42);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.cart-scrim.is-open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(420px, 100%);
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform var(--dur) var(--ease);
  display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
}
.cart-drawer.is-open { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.cart-head h3 { font-family: var(--font-serif); font-weight: 500; font-size: 24px; margin: 0; }
.cart-close { appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--fg); width: 34px; height: 34px; border-radius: 8px; }
.cart-close svg { width: 20px; height: 20px; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 24px; }
.cart-empty { font-family: var(--font-mono); font-size: 13px; color: var(--fg-muted); margin: 32px 0 14px; }
.cart-shop-link { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; appearance: none; border: 0; background: transparent; cursor: pointer; padding: 0; display: inline-block; margin-top: 8px; }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line-img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: contain; background: var(--card-bg); padding: 8px; }
.cart-line-title { font-family: var(--font-mono); font-size: 13px; font-weight: 500; margin: 0 0 4px; }
.cart-line-variant { font-family: var(--font-sans); font-size: 12.5px; color: var(--fg-muted); margin: 0 0 8px; }
.cart-line-qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 2px; }
.cart-line-qty button { appearance: none; border: 0; background: transparent; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; color: var(--fg); font-size: 15px; }
.cart-line-qty span { font-family: var(--font-mono); font-size: 12.5px; min-width: 20px; text-align: center; }
.cart-line-side { text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.cart-line-price { font-family: var(--font-mono); font-size: 13px; }
.cart-line-remove { appearance: none; border: 0; background: transparent; cursor: pointer; font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.cart-line-remove:hover { color: var(--danger); }
.cart-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.cart-subtotal { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 14px; margin-bottom: 6px; }
.cart-note { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); margin: 0 0 14px; }
.cart-error { font-family: var(--font-mono); font-size: 12px; color: var(--danger); margin: 0 0 12px; }
.cart-checkout { width: 100%; justify-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-inner { height: 60px; }
  .brand-word { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .store-grid { grid-template-columns: 1fr; gap: 18px; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}
