/* ==========================================================================
   NEXORA DIGITAL — base.css
   Design tokens, reset, typography, buttons, form controls, layout helpers.
   Every selector is scoped to the Nexora page; portfolio projects run inside
   sandboxed iframes and never inherit these styles.
   ========================================================================== */

:root {
  /* Palette */
  --obsidian: #09090B;
  --charcoal: #111114;
  --graphite: #1A1A1F;
  --graphite-2: #232329;
  --gold: #C6A15B;
  --gold-hi: #E3C68E;
  --gold-lo: #8C7041;
  --ivory: #F4F0E8;
  --ivory-2: rgba(244, 240, 232, .74);
  --ivory-3: rgba(244, 240, 232, .52);
  --metal: #A6A39D;
  --grey: #85827C;
  --blue: #6F9DFF;
  --blue-soft: rgba(111, 157, 255, .14);
  --line: rgba(244, 240, 232, .09);
  --line-2: rgba(244, 240, 232, .16);
  --line-gold: rgba(198, 161, 91, .32);
  --danger: #E59A86;
  --ok: #9FD3A8;

  /* Glass (used sparingly) */
  --glass: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
  --glass-line: rgba(255, 255, 255, .085);

  /* Type */
  --display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;

  --fs-hero: clamp(2.1rem, .95rem + 2.95vw, 3.95rem);
  --fs-h2: clamp(1.95rem, 1.2rem + 2.7vw, 3.7rem);
  --fs-h3: clamp(1.15rem, 1rem + .5vw, 1.45rem);
  --fs-lead: clamp(1.05rem, .98rem + .35vw, 1.22rem);
  --fs-serif-lead: clamp(1.35rem, 1.1rem + .9vw, 1.9rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-tiny: .78rem;

  /* Space & shape */
  --container: 1320px;
  --gutter: clamp(1.25rem, .6rem + 3vw, 3.5rem);
  --section: clamp(6rem, 4rem + 8vw, 11rem);
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --r-pill: 999px;
  --nav-h: 78px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --shadow-float: 0 50px 90px -40px rgba(0, 0, 0, .85), 0 22px 40px -24px rgba(0, 0, 0, .7);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
  background: var(--obsidian);
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ivory);
  background: var(--obsidian);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
address { font-style: normal; }
::selection { background: var(--gold); color: var(--obsidian); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; left: 1rem; top: -80px; z-index: 1000;
  padding: .7rem 1.1rem; border-radius: var(--r-s);
  background: var(--gold); color: var(--obsidian); font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Subtle film grain over the whole page */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: var(--section); }
.section--raised { background: var(--charcoal); }
.section + .section--hairline { border-top: 1px solid var(--line); }

/* ---------- Typography ---------- */
.h-display, .h2 {
  font-family: var(--display);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .005em;
  line-height: 1.04;
  text-wrap: balance;
}
.h2 { font-size: var(--fs-h2); max-width: 18ch; }
.h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: .01em;
}
.lead { font-size: var(--fs-lead); color: var(--ivory-2); max-width: 52ch; line-height: 1.6; }
.serif-lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-serif-lead);
  line-height: 1.35;
  color: var(--ivory);
  max-width: 34ch;
}
.muted { color: var(--ivory-3); }
.gold { color: var(--gold); }
.price {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -.01em;
  font-variant-numeric: lining-nums tabular-nums;
}

.section-head { display: grid; gap: 1.4rem; margin-bottom: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section-head--split {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: end;
  gap: 1.5rem 4rem;
}
.section-head--split .lead { justify-self: end; }

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--ivory); --bd: var(--line-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 52px; padding: .8rem 1.6rem;
  border: 1px solid var(--bd); border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg);
  font-family: var(--display); font-size: .78rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; line-height: 1.2;
  white-space: nowrap; isolation: isolate; overflow: hidden;
  transition: color .4s var(--ease), border-color .4s var(--ease), background-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--gold {
  --bg: var(--gold); --fg: #17130B; --bd: var(--gold);
  box-shadow: 0 14px 34px -16px rgba(198, 161, 91, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--gold::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn--gold:hover::before { transform: translateX(120%); }
.btn--gold:hover { --bg: var(--gold-hi); --bd: var(--gold-hi); }
.btn--ghost:hover { --bd: var(--gold); --fg: var(--gold-hi); }
.btn--glass { --bg: rgba(255, 255, 255, .04); --bd: var(--glass-line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--glass:hover { --bd: var(--line-gold); --fg: var(--gold-hi); }
.btn--whatsapp { --bg: #1F7A4D; --bd: #1F7A4D; --fg: #fff; }
.btn--whatsapp:hover { --bg: #17633E; --bd: #17633E; }
.btn--sm { min-height: 42px; padding: .55rem 1.1rem; font-size: .7rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

.text-link {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--gold); font-weight: 500; font-size: .95rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .45s var(--ease), color .3s;
}
.text-link:hover { background-size: 35% 1px; color: var(--gold-hi); }
.text-link svg { width: 15px; height: 15px; }

/* ---------- Form controls (shared by configurator + contact) ---------- */
.field { display: grid; gap: .45rem; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label, .field__label { font-size: .85rem; font-weight: 500; color: var(--ivory-2); }
.field .req { color: var(--gold); }
.field .opt { color: var(--ivory-3); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: .8rem 1rem;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: rgba(255, 255, 255, .025); color: var(--ivory);
  font-size: 1rem; line-height: 1.4;
  transition: border-color .25s, background-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 120px; resize: vertical; }
.select {
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23C6A15B' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; background-size: 18px;
}
.select option { background: var(--graphite); color: var(--ivory); }
.input::placeholder, .textarea::placeholder { color: rgba(244, 240, 232, .32); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(244, 240, 232, .28); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold); background: rgba(255, 255, 255, .045);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, .16);
}
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--danger); }
.field__error { font-size: .82rem; color: var(--danger); min-height: 0; }
.field__error:empty { display: none; }
.field__hint { font-size: .8rem; color: var(--ivory-3); }

.notice {
  padding: 1rem 1.15rem;
  border-left: 2px solid var(--gold);
  background: rgba(198, 161, 91, .07);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  font-size: var(--fs-small); color: var(--ivory-2);
}
.notice--blue { border-left-color: var(--blue); background: var(--blue-soft); }
.notice strong { color: var(--ivory); font-weight: 600; }

/* placeholder values that the owner still has to fill in (js/config.js) */
.is-placeholder {
  color: var(--ivory-3) !important;
  text-decoration: underline dashed rgba(198, 161, 91, .55);
  text-underline-offset: 4px;
  pointer-events: none;
}

/* Icons injected from js/core.js */
.icon { width: 1em; height: 1em; display: inline-block; flex: none; }
[data-icon] { display: inline-flex; }

@media (max-width: 860px) {
  .section-head--split { grid-template-columns: minmax(0, 1fr); }
  .section-head--split .lead { justify-self: start; }
}
