/* ============================================================
   Mihai Mehedint — site styles
   Zero-JS. Light/dark via prefers-color-scheme. System fonts only
   (no external font requests → privacy, speed, CSP-clean).
   Design system driven by CSS custom properties for scalability.
   ============================================================ */

:root {
  /* Palette — light */
  --bg:        #ffffff;
  --surface:   #f6f7f9;
  --surface-2: #eef0f4;
  --text:      #12161d;
  --muted:     #55606f;
  --border:    #e4e7ee;
  --accent:    #4f46e5;   /* indigo */
  --accent-2:  #0ea5b7;   /* teal   */
  --accent-ink:#ffffff;
  --ring:      #4f46e5;

  /* Type scale */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --step-3:  clamp(2.2rem, 1.8rem + 2.2vw, 3.4rem);

  /* Space & shape */
  --container: 68rem;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(16,22,29,.04), 0 8px 24px rgba(16,22,29,.06);
  --section-y: clamp(3.5rem, 2rem + 6vw, 6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0b0e14;
    --surface:   #11151d;
    --surface-2: #161b25;
    --text:      #e7eaf0;
    --muted:     #9aa5b5;
    --border:    #222a37;
    --accent:    #8b93ff;
    --accent-2:  #3ed0e0;
    --accent-ink:#0b0e14;
    --ring:      #8b93ff;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 0.6rem + 2vw, 2rem);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  font-size: .78rem; letter-spacing: .02em; font-weight: 800;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { font-size: var(--step-0); }
.nav-links { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); font-size: var(--step--1); font-weight: 500;
  padding: .45rem .7rem; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
@media (max-width: 640px) {
  .brand-name { display: none; }
  .nav { flex-wrap: wrap; padding-block: .5rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.25rem; border-radius: 10px;
  font-weight: 600; font-size: var(--step-0);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3.5rem, 2rem + 8vw, 7rem);
  background:
    radial-gradient(60rem 30rem at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(50rem 26rem at -10% 10%, color-mix(in srgb, var(--accent-2) 13%, transparent), transparent 55%);
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: var(--step--1); font-weight: 700; color: var(--accent);
  margin: 0 0 1rem;
}
.hero-title { font-size: var(--step-3); max-width: 20ch; margin-bottom: 1.25rem; }
.hero-title .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; margin-bottom: 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-kicker {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: var(--step--1); font-weight: 700; color: var(--accent-2);
  margin: 0 0 .5rem;
}
.section-title { font-size: var(--step-2); margin-bottom: 1.25rem; }
.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: 2rem; }

/* ---------- Prose (About) ---------- */
.prose { max-width: 65ch; }
.prose p { color: var(--muted); }
.prose strong { color: var(--text); }
.lead-quote {
  font-size: var(--step-1); line-height: 1.5; color: var(--text) !important;
  font-weight: 500; border-left: 3px solid var(--accent);
  padding-left: 1.1rem; margin-bottom: 1.75rem;
}

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.section-alt .card { background: var(--bg); }
.card h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.card p { color: var(--muted); margin: 0; }
.card-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 11px; margin-bottom: 1rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.work-card .work-meta {
  font-size: var(--step--1); color: var(--accent-2);
  font-weight: 600; margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .05em;
}
.soft-card { box-shadow: none; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.tag {
  padding: .45rem .9rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--step--1); font-weight: 500; color: var(--text);
}

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.contact-label {
  min-width: 6rem; font-size: var(--step--1); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.contact-value { font-size: var(--step-1); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: var(--step--1); }
.to-top { color: var(--muted); font-weight: 500; }
.to-top:hover { color: var(--accent); }
