/* ==========================================================================
   MAC 3D LAB — base.css
   Design tokens (dark default + light), fonts, reset, shared components
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Dark theme (default) */
  --bg: #0a0a0a;
  --bg-2: #101010;
  --surface: #141414;
  --surface-2: #1b1b1b;
  --surface-3: #242424;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .24);
  --fg: #f6f6f6;
  --fg-soft: #cfcfcf;
  --muted: #9a9a9a;
  --inv: #0a0a0a;            /* text on top of --fg backgrounds */
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --glow: rgba(255, 255, 255, .06);
  --grid: rgba(255, 255, 255, .055);
  --nav-bg: rgba(10, 10, 10, .72);
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #93c5fd;
  --wa: #25d366;

  --font-display: "Montserrat", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 76px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f6f6f6;
  --surface: #f3f3f3;
  --surface-2: #ebebeb;
  --surface-3: #e0e0e0;
  --line: rgba(0, 0, 0, .12);
  --line-strong: rgba(0, 0, 0, .3);
  --fg: #0a0a0a;
  --fg-soft: #2b2b2b;
  --muted: #616161;
  --inv: #ffffff;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .28);
  --glow: rgba(0, 0, 0, .05);
  --grid: rgba(0, 0, 0, .06);
  --nav-bg: rgba(255, 255, 255, .78);
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #1d4ed8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--fg); color: var(--inv); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icons (SVG sprite) ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i .fill, .i.is-fill { fill: currentColor; stroke: none; }

/* ---------- Logo mark (inline SVG, theme aware) ---------- */
.mk-k { fill: currentColor; stroke: currentColor; }
.mk-p { fill: var(--mark-paper, var(--bg)); stroke: currentColor; }
.mk-l { stroke: currentColor; }
.logo-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); }
.logo-lockup svg { height: 40px; width: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text b { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: .02em; }
.logo-text span { font-family: var(--font-display); font-weight: 600; font-size: .58rem; letter-spacing: .42em; margin-top: 5px; color: var(--muted); }
.logo-img-light { display: none; }
[data-theme="light"] .logo-img-dark { display: none; }
[data-theme="light"] .logo-img-light { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: .95em 1.7em; border-radius: 999px; font-family: var(--font-display);
  font-weight: 700; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1.5px solid transparent; transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .25s;
  white-space: nowrap; line-height: 1;
}
.btn .i { width: 1.2em; height: 1.2em; transition: transform .25s var(--ease); }
.btn:hover .i-arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--fg); color: var(--inv); border-color: var(--fg); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px var(--fg); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--fg); background: var(--glow); transform: translateY(-2px); }
.btn-wa { background: var(--wa); color: #06210f; border-color: var(--wa); }
.btn-wa:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--wa); }
.btn-sm { padding: .75em 1.25em; font-size: .74rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-display); }
.control {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--fg);
  transition: border-color .2s, background .2s, box-shadow .2s; font-size: .97rem;
}
.control::placeholder { color: var(--muted); opacity: .75; }
.control:hover { border-color: var(--line-strong); }
.control:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 4px var(--glow); background: var(--bg-2); }
select.control { appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
textarea.control { min-height: 132px; resize: vertical; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--fg); transition: background .2s, transform .3s var(--ease), border-color .2s;
  flex: none;
}
.theme-toggle:hover { background: var(--glow); border-color: var(--fg); transform: rotate(18deg); }
.theme-toggle .i { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* ---------- Flash messages ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid var(--line); background: var(--surface); margin-bottom: 10px; }
.flash .i { margin-top: 2px; }
.flash.success { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.flash.danger, .flash.error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.flash.warning { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.flash.info { border-color: color-mix(in srgb, var(--info) 50%, transparent); color: var(--info); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
