/* IA Studio showcase — brand styling.
   Palette: navy #16213A, cream #FBF7EC, amber #E8A13A.
   Light and dark themes via [data-theme] on <html>, defaulting to the OS setting. */

:root {
  --navy: #16213A;
  --cream: #FBF7EC;
  --amber: #E8A13A;
  --amber-dark: #cf8b28;

  /* Light theme (default) */
  --bg: var(--cream);
  --surface: #ffffff;
  --surface-2: #f4efe1;
  --text: var(--navy);
  --muted: #5a6172;
  --border: #e3ddcc;
  --accent: var(--amber);
  --accent-ink: var(--navy);
  --shadow: 0 1px 2px rgba(22, 33, 58, .06), 0 8px 24px rgba(22, 33, 58, .06);
  --focus: #2b5fd9;

  --maxw: 1080px;
  --radius: 12px;
  --radius-sm: 8px;
  --space: 1rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #16213A;
  --surface-2: #1d2b49;
  --text: var(--cream);
  --muted: #9aa4bd;
  --border: #26324f;
  --accent: var(--amber);
  --accent-ink: var(--navy);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --focus: #7aa2ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #16213A;
    --surface-2: #1d2b49;
    --text: var(--cream);
    --muted: #9aa4bd;
    --border: #26324f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --focus: #7aa2ff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .brand-name { font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { font-weight: 600; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
}

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .04s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--amber-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; }

.chip {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  padding: .22rem .6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 40ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero .cred { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.hero .cred::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.hero-art {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); background: var(--surface);
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-art { order: -1; }
}

/* ---------- Section headings ---------- */
.section { padding: clamp(2rem, 4vw, 3.25rem) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.section-head .count { color: var(--muted); font-size: .9rem; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Product grid + cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); text-decoration: none; }
.card:focus-within { box-shadow: var(--shadow); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-body .chip { align-self: flex-start; }
.card h3 { margin: .1rem 0 0; }
.card .card-tag { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.card .card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.card .price { font-weight: 700; }
.card .price .from { color: var(--muted); font-weight: 500; font-size: .82rem; }
.card .markets { color: var(--muted); font-size: .82rem; }

.category-group { margin-bottom: 2.5rem; }
.category-group:last-child { margin-bottom: 0; }

/* ---------- Category pills (home) ---------- */
.cat-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 700px) { .cat-pills { grid-template-columns: 1fr; } }
.cat-pill {
  display: block; padding: 1.25rem 1.25rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.cat-pill:hover { border-color: var(--accent); text-decoration: none; }
.cat-pill strong { display: block; font-size: 1.05rem; }
.cat-pill span { color: var(--muted); font-size: .9rem; }

/* ---------- Product detail ---------- */
.crumbs { color: var(--muted); font-size: .9rem; padding-top: 1.5rem; }
.crumbs a:hover { color: var(--text); }
.product { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; padding: 1.25rem 0 0; align-items: start; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 1.5rem; } }

.gallery .main {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.gallery .main img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery .thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.gallery .thumbs button {
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; background: var(--surface); width: 84px; aspect-ratio: 16/10;
}
.gallery .thumbs button[aria-current="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { margin-bottom: .3rem; }
.product-info .tagline { color: var(--muted); font-size: 1.1rem; margin-bottom: 1rem; }
.product-info .desc { margin-bottom: 1.25rem; }
.features { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.features li { position: relative; padding-left: 1.6rem; }
.features li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: .5rem; height: .5rem; border-radius: 2px; background: var(--accent);
}

/* Buy box */
.buybox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.buybox h2 { font-size: 1.15rem; margin-bottom: .25rem; }
.buybox .hint { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.buy-list { display: grid; gap: .6rem; }
.buy-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.buy-btn:hover { background: var(--amber-dark); text-decoration: none; }
.buy-btn .market { display: flex; align-items: center; gap: .55rem; }
.buy-btn .price { font-variant-numeric: tabular-nums; }
.buy-btn .price .live { font-size: .7rem; font-weight: 700; opacity: .8; margin-left: .35rem; }
.buy-btn .ext { opacity: .7; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: start; padding-top: 1rem; }
@media (max-width: 700px) { .about { grid-template-columns: 1fr; } }
.about .portrait { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.about .links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.prose { max-width: 62ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; padding: 2.5rem 0; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; } }
.footer-grid h4 { margin: 0 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer-grid a { color: var(--muted); display: block; padding: .2rem 0; }
.footer-grid a:hover { color: var(--text); }
.footer-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.1rem 0; color: var(--muted); font-size: .85rem; }
