/* Piedra & Sal — coastal storefront theme.
   Palette lock: deep-sea ink + foam neutrals + ONE accent (ember).
   Shape rule: media/cards 18px · buttons full-pill · inputs 12px. */
:root {
  --bg: #edf2f0;
  --surface: #ffffff;
  --surface-2: #dfe9e5;
  --ink: #0e2420;
  --muted: #4f645e;
  --line: #d5e0db;
  --accent: #b0491f;
  --accent-strong: #94400f;
  --accent-soft: #f6e2d4;
  --accent-ink: #ffffff;
  --sea: #0c3830;
  --sea-ink: #f2f7f5;
  --shadow: 0 18px 40px -18px rgba(12, 56, 48, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  --bg: #0a1e1a;
  --surface: #102825;
  --surface-2: #173330;
  --ink: #eaf3ef;
  --muted: #9db4ad;
  --line: #1f3a34;
  --accent: #f2703f;
  --accent-strong: #f2703f;
  --accent-soft: #3a2318;
  --accent-ink: #221006;
  --sea: #0e2a25;
  --sea-ink: #eaf3ef;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; }
a { color: inherit; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 80px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; }
.brand-logo {
  height: 50px; width: auto; flex: none;
}
/* The mark is a black SVG loaded via <img> (currentColor can't inherit there),
   so force it white in dark mode. */
html[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); }
/* Full lockup is wide (5.4:1) — sit it a touch smaller than the mark. */
.brand-lockup { height: 42px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { text-decoration: none; font-size: 16px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-radius: 999px; }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 14px; border-radius: 999px; padding: 8px 15px; cursor: pointer; letter-spacing: 0.04em; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.seg button:not(.active):hover { color: var(--ink); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
html[data-theme="dark"] .icon-btn:hover { color: var(--accent); }
.icon-btn:active { transform: scale(0.96); }

/* ---------- hero (split, fits viewport) ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-block: 56px 48px; min-height: min(86dvh, 720px); }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin: 0 0 14px; }
html[data-theme="dark"] .kicker { color: var(--accent); }
.hero h1 { margin: 0 0 14px; font-size: clamp(38px, 5.2vw, 62px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--accent-strong); }
html[data-theme="dark"] .hero h1 em { color: var(--accent); }
.lede { margin: 0 0 26px; font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 44ch; }
.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 16px;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 14px 28px; border: 0; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(0.98); }
/* WhatsApp join keeps its brand green so buyers recognize it instantly. */
.wa-btn { background: #128c4b; color: #fff; width: 100%; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.wa-btn i { font-size: 22px; }
.wa-btn[aria-disabled="true"] { opacity: 0.55; }
.hero-media { position: relative; margin: 0; }
.hero-media img { display: block; width: 100%; height: clamp(320px, 52dvh, 520px); object-fit: cover; border-radius: 18px; box-shadow: var(--shadow); background: var(--surface-2); }
.catch-chip {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px;
}
.catch-chip .dot { width: 10px; height: 10px; border-radius: 999px; background: #1e9e6a; flex: none; }
.catch-chip > span { min-width: 0; }
.catch-chip strong { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catch-chip span { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.catch-chip .go { margin-left: auto; font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
html[data-theme="dark"] .catch-chip .go { color: var(--accent); }

/* ---------- board ---------- */
.board-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-block: 56px 20px; flex-wrap: wrap; }
.board-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; }
.board-head p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.date-pick { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.feature { display: grid; grid-template-columns: 1.4fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 18px; }
.feature img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; display: block; background: var(--surface-2); }
.feature .f-body { padding: 30px 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 5px 12px 5px 10px; background: var(--accent-soft); color: var(--accent-strong); }
html[data-theme="dark"] .badge { color: var(--accent); }
.badge i { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.feature h3, .card h3 { margin: 2px 0 0; letter-spacing: -0.015em; }
.feature h3 { font-size: 32px; }
.card h3 { font-size: 20px; }
.price { font-family: var(--mono); font-weight: 700; color: var(--accent-strong); }
html[data-theme="dark"] .price { color: var(--accent); }
.feature .price { font-size: 26px; }
.card .price { font-size: 19px; }
.meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.notes { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img { width: 100%; height: 210px; object-fit: cover; display: block; background: var(--surface-2); }
.card .body { padding: 18px; display: flex; flex-direction: column; gap: 7px; }
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line); border-radius: 18px; background: var(--surface); }
.empty i { font-size: 34px; color: var(--accent-strong); }
html[data-theme="dark"] .empty i { color: var(--accent); }
.empty h3 { margin: 12px 0 6px; font-size: 21px; }
.empty p { margin: 0; color: var(--muted); }

/* ---------- subscribe (split panel) ---------- */
.alert-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; background: var(--sea); color: var(--sea-ink); border-radius: 18px; padding: clamp(28px, 4vw, 52px); margin: 64px 0 24px; }
.alert-panel h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.02em; }
.alert-panel p { margin: 0 0 20px; color: var(--sea-ink); opacity: 0.82; font-size: 16px; line-height: 1.55; max-width: 40ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.steps b { font-family: var(--mono); color: var(--accent); font-size: 13px; }
.sub-card { background: var(--surface); color: var(--ink); border-radius: 28px; padding: 26px; }
.field { display: grid; gap: 8px; margin-bottom: 14px; min-width: 0; } /* min-width: grid children (date inputs especially) can otherwise force the column wider than the phone */
.field label { font-size: 14px; font-weight: 700; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%; max-width: 100%; min-width: 0;
  display: block;
}
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa09a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input[type="file"] { cursor: pointer; }
.field input[type="file"]::file-selector-button {
  font: inherit; font-size: 14px; font-weight: 800; color: var(--accent-ink);
  background: var(--accent); border: 0; border-radius: 999px;
  padding: 9px 18px; margin-right: 12px; cursor: pointer;
}
.field .err { font-size: 13px; color: #c22f2f; min-height: 18px; margin: 0; font-weight: 600; }
html[data-theme="dark"] .field .err { color: #ff9a7a; }
.msg { font-weight: 700; font-size: 15px; margin: 10px 0 0; }
.msg.ok { color: #1e9e6a; }
/* Pending WhatsApp note lives on the white card: keep it off the panel's light-text rule. */
.sub-card .msg { color: var(--muted); opacity: 1; text-align: center; margin: 14px 0 0; line-height: 1.5; }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.sub-card .fine { color: var(--muted); opacity: 1; text-align: center; margin-top: 16px; line-height: 1.5; }

/* ---------- seller lock (casual gate: real protection is the repo's collaborator list) ---------- */
.lock { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); }
.lock[hidden] { display: none; }
.lock-card { width: min(420px, 100%); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.lock-card h2 { margin: 0 0 6px; font-size: 22px; }
.lock-card p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.lock-err { min-height: 20px; margin: 10px 0 0; font-size: 14px; font-weight: 700; color: #c22f2f; }
html[data-theme="dark"] .lock-err { color: #ff9a7a; }

/* ---------- footer / admin shared ---------- */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px 40px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.panel h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.01em; }
.panel p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.panel pre { background: var(--sea); color: var(--sea-ink); padding: 16px; border-radius: 12px; overflow: auto; font-size: 13px; line-height: 1.6; }
.panel code { font-family: var(--mono); font-size: 0.9em; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 32px; }
pre.outbox { background: var(--sea); color: var(--sea-ink); padding: 16px; border-radius: 12px; overflow: auto; max-height: 320px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-small { font-size: 14px; padding: 9px 16px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.page-head { padding-block-start: 48px; }
.page-head h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.025em; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 62ch; }

/* ---------- reveal motion (gentle; off under reduced motion) ---------- */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .hero { gap: 32px; }
  .feature .f-body { padding: 24px 22px; }
  .alert-panel { gap: 28px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; padding-block: 40px; }
  .hero-media img { height: 300px; }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature img { min-height: 0; height: 260px; }
  .alert-panel { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .nav-links { display: none; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .nav-inner { padding: 0 16px; gap: 10px; height: 72px; }
  .brand { font-size: 18px; }
  .brand-logo { height: 42px; }
  .brand-lockup { height: 34px; }
  .hero { padding-block: 32px; }
  .hero h1 { font-size: clamp(32px, 9.5vw, 40px); }
  .lede { font-size: 16px; margin-bottom: 22px; }
  .cta-row { flex-direction: column; align-items: stretch; text-align: center; gap: 14px; }
  .cta-row .btn { text-align: center; }
  .hero-media img { height: 250px; }
  .catch-chip { left: 10px; right: 10px; bottom: 10px; padding: 10px 12px; }
  .board-head { padding-block: 40px 16px; flex-direction: column; align-items: stretch; }
  .date-pick { width: 100%; }
  .feature h3 { font-size: 26px; }
  .feature .price { font-size: 22px; }
  .feature .f-body { padding: 22px 20px; }
  .card img { height: 190px; }
  .alert-panel { padding: 26px 20px; margin: 48px 0 16px; }
  .sub-card { padding: 20px; }
  .panel { padding: 20px; }
  .panel pre { font-size: 12px; }
  .page-head { padding-block-start: 32px; }
  .foot { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-block: 32px 48px; }
  .foot a { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover { transform: none; }
}
