/* =========================================================================
   Dunross AI — stylesheet
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg:           #0a0a0a;
  --bg-subtle:    #111111;
  --bg-elevated:  #141414;
  --text:         #fafafa;
  --text-muted:   #a3a3a3;
  --text-faint:   #525252;
  --border:       #262626;
  --border-strong:#333333;
  --accent:       #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-soft:  rgba(139, 92, 246, 0.12);
  --focus-ring:   rgba(139, 92, 246, 0.55);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --max-w:     1200px;
  --max-w-narrow: 760px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);

  --ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Base ---------- */
html { background: var(--bg); }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

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

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); letter-spacing: -0.015em; }
h4 { font-size: 1rem; }

p { color: var(--text-muted); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.55; color: var(--text-muted); max-width: 56ch; }

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

.accent { color: var(--accent); }
.muted  { color: var(--text-muted); }
.faint  { color: var(--text-faint); }
.mono   { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: 0.01em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: var(--max-w-narrow); }

section { padding: clamp(64px, 9vw, 128px) 0; }
section + section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: clamp(40px, 5vw, 64px); max-width: 720px; }
.section-head h2 { margin-bottom: 16px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  z-index: 1000;
}
.skip-link:focus { left: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.035em;
  color: var(--accent);
  line-height: 1;
}
.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}
.logo-text { white-space: nowrap; }
.footer .logo { font-size: 1.05rem; gap: 8px; }
.footer .logo-mark { width: 24px; height: 24px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.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(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  }
  .nav-links a {
    padding: 14px 24px;
    font-size: 1rem;
    color: var(--text);
  }
  .nav[data-open="true"] .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.05s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  padding: 0 12px;
}
.btn-ghost:hover { color: var(--accent); }

.btn .arrow { transition: transform 0.15s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(60px, 8vw, 96px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: min(900px, 90vw);
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 62%);
  opacity: 0.32;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}
.hero > .container { position: relative; }
.hero h1 {
  max-width: 18ch;
  margin-bottom: 28px;
}
.hero h1 .turn {
  display: block;
  color: var(--accent);
}
.hero .lead {
  margin-bottom: 40px;
  max-width: 58ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.hero-meta {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.hero-meta .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Steps (How we work) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step {
  position: relative;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
}
.step h3 { margin-bottom: 12px; }
.step p  { color: var(--text-muted); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Card grid (services summary) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-grid > .card {
  background: var(--bg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 0.15s var(--ease);
}
.card-grid > .card:hover { background: var(--bg-subtle); }
@media (min-width: 761px) {
  .card-grid > .card.card-full { grid-column: 1 / -1; }
}

.card h3 { font-size: 1.1rem; }
.card .card-meta {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.85rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Service icons ---------- */
.service-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 18px;
}
.service-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.service-left .service-icon { margin-bottom: 16px; }

@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- Case studies placeholder ---------- */
.cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.case-card {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-faint);
  background: var(--bg-subtle);
}
.case-card .case-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-card h4 { color: var(--text-muted); font-weight: 500; max-width: 22ch; }

@media (max-width: 900px) { .cases { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cases { grid-template-columns: 1fr; } }

/* ---------- Closing CTA ---------- */
.cta-band {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.cta-band h2 { max-width: 22ch; margin: 0; }
.cta-band p  { max-width: 40ch; margin-top: 8px; }

/* ---------- Services page ---------- */
.service-list {
  display: flex;
  flex-direction: column;
}
.service {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--border);
}
.service:first-child { border-top: 0; padding-top: 0; }
.service-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.service h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 16px; }
.service-left p { max-width: 40ch; }
.service-right h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
  font-weight: 500;
}
.service-right ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-right li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.55;
}
.service-right li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

@media (max-width: 880px) {
  .service { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

.contact-meta { display: flex; flex-direction: column; gap: 24px; }
.contact-meta dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.contact-meta dd { margin: 0; color: var(--text); }
.contact-meta a { color: var(--accent); }
.contact-meta a:hover { color: var(--accent-hover); }

form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.field .hint { font-size: 0.78rem; color: var(--text-faint); }

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23737373' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
  padding-right: 36px;
}

.form-feedback {
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
.form-feedback.success {
  display: block;
  background: var(--accent-soft);
  color: var(--accent);
}
.form-feedback.error {
  display: block;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

/* ---------- About placeholder ---------- */
.about-stub {
  padding: clamp(80px, 12vw, 160px) 0;
}
.about-stub h1 { margin-bottom: 24px; }
.about-stub p { max-width: 50ch; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer .logo { font-size: 0.95rem; }
.footer-meta { display: flex; gap: 24px; align-items: center; }
.footer-meta a { color: var(--text-muted); }
.footer-meta a:hover { color: var(--text); }

/* ---------- 404 ---------- */
.center-stage {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.center-stage .mono { color: var(--accent); margin-bottom: 16px; }
.center-stage h1 { margin-bottom: 16px; }
.center-stage p { max-width: 40ch; margin-bottom: 32px; }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   SaaS additions (Klara) — new components only; all rules above are unchanged
   ========================================================================= */

/* Nav CTA button */
.nav-links a.nav-cta {
  background: var(--accent);
  color: #fff;
  height: 34px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background-color 0.15s var(--ease);
}
.nav-links a.nav-cta:hover { background: var(--accent-hover); color: #fff; }

/* Nav secondary text link (Log in) — lighter weight than primary links */
.nav-login {
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color 0.15s var(--ease);
}
.nav-login:hover { color: var(--text); }

/* Language pills (home teaser) */
.lang-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}

/* Language grid (languages page) — auto-fill responsive cards */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.lang-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.lang-card:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.lang-card .native { display: block; font-size: 1.05rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.lang-card .english { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* Pricing tiers */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: stretch; }
.tier {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.tier::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.45;
}
.tier.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.tier.featured::before { opacity: 1; }
.tier-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #fff;
  padding: 4px 9px;
  border-radius: 999px;
}
.tier-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.tier-price { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.tier-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-faint); letter-spacing: 0; }
.tier-tagline { color: var(--text-muted); font-size: 0.9rem; }
.tier ul { display: flex; flex-direction: column; gap: 10px; }
.tier li { position: relative; padding-left: 20px; font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.tier li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 1px; background: var(--accent); }
.tier .btn { width: 100%; margin-top: auto; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Pricing teaser (home) — compact tiers */
.tier-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tier-mini {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tier-mini .tier-price { font-size: 1.5rem; }
@media (max-width: 880px) { .tier-mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tier-mini-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: flex; flex-direction: column; }
.faq-item { padding: 24px 0; border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; padding-top: 0; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.faq-item p { color: var(--text-muted); max-width: 70ch; }

/* Footer legal links */
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-faint); }
.footer-links a:hover { color: var(--text); }

/* ---------- Motion (respect prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
