/* ==========================================================================
   dogaru.xyz base.css
   Owner: Dev BASE. Design tokens + utility foundation for all pages.
   Other stylesheets (hub.css, intent.css, landing.css) consume these tokens
   and utilities; they never redefine :root tokens.
   This file is also the ONLY stylesheet of 404.html, so bare semantic HTML
   must look decent with it alone.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (pinned, see CONVENTIONS section 5)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-Variable.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111827;
  --surface: #1F2937;
  --card: #36454F;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --slate: #A8B8CC;
  --accent: #6EE7B7;
  --accent-hover: #5BCFA5;
  --btn-text: #020617;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);
  --touch-min: 48px;
  --measure: 68ch;
  --space-section: 112px;
  --container: 1160px;
  --border-subtle: color-mix(in srgb, var(--text) 14%, transparent);
  --border-muted: color-mix(in srgb, var(--text) 22%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* --------------------------------------------------------------------------
   2. Minimal reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. Body typography
   Mobile first: 16px up to 640px, 17px above. Line-height 1.65.
   -------------------------------------------------------------------------- */

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

/* Soft film grain (opacity <= 0.05). Decorative only. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@media (min-width: 641px) {
  body {
    font-size: 17px;
  }
}

::selection {
  background-color: var(--accent);
  color: var(--btn-text);
}

p,
ul,
ol,
blockquote,
figure,
pre {
  margin-block: 0 1em;
  overflow-wrap: break-word;
}

ul,
ol {
  padding-inline-start: 1.4em;
}

li + li {
  margin-top: 0.35em;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  font-size: 1.05em;
}

pre {
  overflow-x: auto;
  padding: 16px;
  background-color: color-mix(in srgb, var(--text) 4%, transparent);
  border-radius: 8px;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin-block: 2.5em;
}

small {
  font-size: 0.82em;
}

strong {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. Headings
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
  margin-block: 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 1.3rem + 4vw, 3.4rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.55rem, 1.15rem + 2vw, 2.25rem);
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.4rem);
  line-height: 1.3;
}

h4 {
  font-size: 1.1rem;
  line-height: 1.35;
}

h5,
h6 {
  font-size: 1rem;
  line-height: 1.4;
}

* + h2,
* + h3,
* + h4 {
  margin-top: 1.6em;
}

/* --------------------------------------------------------------------------
   5. Links and focus
   -------------------------------------------------------------------------- */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   6. Layout utilities
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 641px) {
  .container {
    padding-inline: 32px;
  }
}

.section {
  padding-block: 72px;
}

@media (min-width: 769px) {
  .section {
    padding-block: var(--space-section);
  }
}

.prose {
  max-width: var(--measure);
}

.prose > :last-child {
  margin-bottom: 0;
}

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.btn {
  background-color: var(--accent);
  color: var(--btn-text);
  border: 1px solid var(--accent);
}

.btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--btn-text);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */

label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

input + label,
select + label,
textarea + label,
p + label {
  margin-top: 18px;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  color: var(--text);
  background-color: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--text) 40%, transparent);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

select {
  cursor: pointer;
  color-scheme: dark;
}

select option {
  color: #0F172A;
  background-color: #F8FAFC;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  background-color: color-mix(in srgb, var(--text) 4%, transparent);
}

.form-status.success,
.form-status.is-success {
  color: var(--accent);
  border-color: var(--accent-border);
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
}

.form-status.error,
.form-status.is-error {
  color: #FCA5A5;
  border-color: rgba(248, 113, 113, 0.45);
  background-color: rgba(248, 113, 113, 0.08);
}

.form-status a {
  color: inherit;
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   9. FAQ
   -------------------------------------------------------------------------- */

details {
  border-top: 1px solid var(--border-subtle);
  max-width: var(--measure);
}

details:last-of-type {
  border-bottom: 1px solid var(--border-subtle);
}

summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05em;
  line-height: 1.4;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  padding: 14px 4px;
  transition: color 0.15s ease;
}

summary:hover {
  color: var(--accent);
}

summary::marker {
  color: var(--accent);
}

details > :not(summary) {
  padding: 0 4px;
}

details > :last-child:not(summary) {
  padding-bottom: 24px;
}

/* --------------------------------------------------------------------------
   10. Accessibility helpers
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 16px;
  z-index: 1000;
  background-color: var(--accent);
  color: var(--btn-text);
  font-weight: 700;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  transform: translateY(-120%);
  transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--btn-text);
}

/* --------------------------------------------------------------------------
   11. Consent banner (bottom-right, subtle)
   -------------------------------------------------------------------------- */

.consent-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.consent-banner.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.consent-banner__text {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}

.consent-banner__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.consent-banner__accept,
.consent-banner__decline {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  min-height: var(--touch-min);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.consent-banner__accept {
  background-color: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}

.consent-banner__accept:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.consent-banner__decline {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-muted);
}

.consent-banner__decline:hover {
  color: var(--text);
  border-color: var(--text);
}

@media (max-width: 480px) {
  .consent-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}

/* --------------------------------------------------------------------------
   12. Legal / privacy pages
   -------------------------------------------------------------------------- */

.legal-header {
  padding-block: 12px;
  background-color: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border-subtle);
}

.legal-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-header .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 12px 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
}

.legal-back:hover,
.legal-back:focus-visible {
  color: var(--accent);
}

.legal-page .site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-subtle);
  margin-top: 48px;
  padding-block: 36px 48px;
  font-size: 15px;
}

.legal-page .site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
}

.legal-page .footer-nav {
  margin: 0;
}

.legal-page .footer-nav a,
.legal-page .footer-meta a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 12px 4px;
}

.legal-page .footer-meta {
  color: var(--muted);
  margin: 0;
}

.legal-updated {
  margin-top: 2.5em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   13. 404 hierarchy
   -------------------------------------------------------------------------- */

.not-found-en {
  margin-bottom: 1.5em;
}

.not-found-ro {
  padding-top: 1.5em;
  border-top: 1px solid var(--border-subtle);
  color: var(--muted);
}

.not-found-links {
  list-style: none;
  margin: 2em 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.not-found-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 12px 4px;
  text-decoration: none;
}

.not-found-links__primary a {
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.not-found-links__secondary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   14. Reduced motion
   -------------------------------------------------------------------------- */

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