/* Raefen Labs — shared base styles.
   Colours and body font are set by the theme file (theme-*.css). */

@font-face {
  font-family: "Science Gothic";
  src: url("science-gothic.woff2") format("woff2-variations"),
       url("science-gothic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 200%;
  font-style: oblique 0deg 10deg;
  font-display: swap;
}

/* Michroma: headline, section headings, contact email (one weight only) */
@font-face {
  font-family: "Michroma";
  src: url("michroma.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --display: "Science Gothic", "Arial Narrow", Arial, sans-serif;   /* wordmark */
  --headings: "Michroma", "Arial", sans-serif;                     /* headline + headings */
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--body-size, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; color: var(--heading); }
p { margin: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* small label style, used sparingly */
.eyebrow, .label, .contacts dt, .social-h, .card-num {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
          backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--heading); }
.brand img { width: 28px; }
.brand-name {
  font-family: var(--display);
  font-size: 1.02rem; font-weight: 300; font-stretch: 130%;
  letter-spacing: 0.03em; line-height: 1; color: var(--muted-strong);
}
.brand-name b { font-weight: 800; color: var(--heading); }

.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav-links a {
  font-size: 0.92rem; font-weight: 500;
  text-decoration: none; color: var(--muted-strong);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--heading); }
.nav-cta {
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--heading) !important;
}
.nav-cta:hover { border-color: var(--heading); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 26px;
  border: 1px solid transparent; border-radius: 2px;
  font-family: var(--body);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); color: var(--heading); }
.btn-ghost:hover { border-color: var(--heading); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(calc(100svh - var(--nav-h)), 860px);
  display: flex; align-items: center;
  padding: clamp(64px, 10vh, 120px) 0;
  overflow: hidden;
}
.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}
.eyebrow .sep { color: var(--accent); margin: 0 0.6em; }
.hero h1 {
  margin-top: 28px;
  font-family: var(--headings);
  font-size: clamp(2rem, 4.3vw, 3.2rem);
  font-weight: 400 !important;
  font-synthesis: none;
  line-height: 1.16;
  letter-spacing: 0;
}
.hero h1 .line { display: block; }
@media (min-width: 641px) { .hero h1 .line { white-space: nowrap; } }
.lead {
  margin-top: 28px;
  max-width: 32em;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--text);
}
.hero-mark { display: flex; justify-content: center; }
.hero-mark img { width: min(100%, 380px); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vh, 140px) 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }

.label span { color: var(--accent); margin-right: 0.8em; }
h2 {
  margin-top: 16px;
  font-family: var(--headings);
  font-size: clamp(1.75rem, 3.6vw, 2.8rem);
  font-weight: 400; font-synthesis: none;
  line-height: 1.15; letter-spacing: 0;
}
.section-intro { margin-top: 20px; max-width: 36em; font-size: 1.15rem; }
h3 { font-family: var(--body); font-size: 1.3rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }

/* about */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 110px);
  margin-top: 56px;
  align-items: start;
}
.story p + p { margin-top: 1.1em; }
.story-lead { font-size: 1.35rem; line-height: 1.5; color: var(--heading); }
.story em { color: var(--heading); }
.ai h3 { font-size: 1.3rem; }
.ai-intro { margin-top: 14px; }
.pillars { margin-top: 32px; counter-reset: pillar; }
.pillars li {
  counter-increment: pillar;
  position: relative;
  padding: 26px 0 26px 56px;
  border-top: 1px solid var(--line);
}
.pillars li:last-child { border-bottom: 1px solid var(--line); }
.pillars li::before {
  content: counter(pillar, decimal-leading-zero);
  position: absolute; left: 0; top: 28px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  color: var(--accent);
}
.pillars h4 { font-family: var(--body); font-size: 1.05rem; font-weight: 600; }
.pillars p { margin-top: 6px; }

/* services */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin-top: 56px;
}
.card {
  padding: 40px 36px 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}
.card-num { display: block; color: var(--accent); margin-bottom: 28px; }
.card p { margin-top: 14px; }

/* careers */
.roles { margin-top: 48px; border-top: 1px solid var(--line); }
.role {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.role h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
.note { margin-top: 28px; max-width: 42em; color: var(--muted-strong); }
.note a { color: var(--heading); }

/* contact */
.big-mail {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--headings);
  font-size: clamp(1.3rem, 4.4vw, 2.6rem);
  font-weight: 400; font-synthesis: none;
  color: var(--heading);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
  overflow-wrap: anywhere;
}
.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 28px;
  margin: 56px 0 0; padding-top: 36px;
  border-top: 1px solid var(--line);
}
.contacts dd { margin: 8px 0 0; }
.contacts a { color: var(--heading); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contacts a:hover { border-color: var(--accent); }
.pgp { margin-left: 10px; font-size: 0.85rem; color: var(--accent) !important; border-bottom-color: transparent !important; }

.social { margin-top: 48px; }
.social-h { margin-bottom: 14px; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.social-links a {
  font-weight: 500; text-decoration: none; color: var(--heading);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
}
.social-links a::after { content: " \2197"; color: var(--accent); }
.social-links a:hover { border-color: var(--accent); }

/* footer */
.footer { background: var(--footer-bg); color: var(--footer-text); padding: 48px 0 56px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px 32px; }
.footer .brand { color: var(--footer-heading); }
.footer .brand img { width: 24px; }
.footer .brand-name { font-size: 0.92rem; color: var(--footer-text); }
.footer .brand-name b { color: var(--footer-heading); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 28px; }
.footer-links a { font-size: 0.9rem; text-decoration: none; color: var(--footer-text); }
.footer-links a:hover { color: var(--footer-heading); }
.legal { grid-column: 1 / -1; font-size: 0.82rem; color: var(--footer-text); opacity: 0.75; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; justify-content: center; }
  .hero-copy .eyebrow { text-align: center; }
  .hero-mark img { width: 120px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --nav-h: 104px; }
  .nav-inner { flex-direction: column; justify-content: center; gap: 14px; }
  .nav-inner nav { width: 100%; }
  .nav-links { width: 100%; justify-content: space-between; gap: 8px; }
  .nav-links a { font-size: 0.86rem; }
  .nav-cta { padding: 6px 12px; }
  .hero { min-height: 0; }
  .hero h1 { font-size: clamp(1.4rem, 7.6vw, 2rem); }
  .hero h1 .line { white-space: nowrap; }
  .big-mail { font-size: clamp(1rem, 6.4vw, 1.6rem); white-space: nowrap; }
  .actions .btn { flex: 1 1 100%; }
  .pillars li { padding-left: 44px; }
  .role .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
