/* =============================================================================
 * cv-rimaslogic — styles
 * Aesthetic: "editorial engineering dossier" on the Rimas Logic brand.
 * Electric Blue on near-black · PT Serif display · PT Sans body ·
 * Inconsolata mono for labels/dates/numbers · blueprint grid · hairline rules.
 * ========================================================================== */

:root {
  --brand-blue: #3D63FF;
  --brand-blue-light: #5A7DFF;
  --brand-blue-dark: #2A4AD9;

  --bg-primary: #010101;
  --bg-secondary: #07070C;
  --bg-card: #0D0D14;
  --bg-card-hover: #13131C;

  --text-primary: #F0F0F5;
  --text-secondary: #9A9AAC;
  --text-muted: #8A8A98;        /* ≥4.5:1 on near-black (WCAG AA for small text) */

  --border: #1E1E29;
  --border-light: #2E2E3C;

  --font-head: "PT Serif", Georgia, serif;
  --font-body: "PT Sans", system-ui, sans-serif;
  --font-mono: "Inconsolata", "SF Mono", ui-monospace, monospace;

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; font-weight: 700; }
a { color: inherit; text-decoration: none; }

/* Keyboard focus — visible ring on every interactive element (a11y) */
:focus-visible { outline: 2px solid var(--brand-blue-light); outline-offset: 3px; }
.btn:focus-visible { outline-offset: 4px; }

/* Mono utility — the "engineering" texture */
.eyebrow, .band-label, .section-index, .job-period, .offer-meta,
.nav a, .track-label, .stat-label, .testimonial .who,
.contact-langs, .cred-list li, .footer p {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.5rem; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap; position: relative;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2.2rem; font-size: 1.1rem; }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-primary:hover { background: var(--brand-blue-light); transform: translateY(-2px); }
.btn-primary:active { background: var(--brand-blue-dark); transform: translateY(0); }
.btn-primary::after { content: "→"; transition: transform 0.2s var(--ease); }
.btn-primary:hover::after { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-light); }
.btn-ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue-light); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(1, 1, 1, 0.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.topbar.scrolled { border-bottom-color: var(--border); background: rgba(1, 1, 1, 0.88); }
.brand img { height: 32px; width: auto; display: block; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a {
  color: var(--text-secondary); font-size: 0.82rem; text-transform: uppercase;
  position: relative; padding-bottom: 3px; transition: color 0.18s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--brand-blue); transition: width 0.25s var(--ease);
}
.nav a:hover { color: var(--text-primary); }
.nav a:hover::after { width: 100%; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
/* ---------- Layout primitives ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.1rem, 4vw, 2rem); }
#offer { padding-bottom: clamp(1.75rem, 4vw, 3.25rem); }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start; margin-bottom: 2.6rem; }
.section-index {
  font-size: 0.85rem; color: var(--brand-blue); font-weight: 700;
  padding-top: 0.7rem; border-top: 2px solid var(--brand-blue);
}
.section-head h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
.section-intro { color: var(--text-secondary); max-width: 56ch; margin-top: 0.5rem; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--border); overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(61,99,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,99,255,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 35%, transparent 78%);
}
.hero-inner {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.1rem, 4vw, 2rem) clamp(3rem, 7vw, 5rem);
  display: grid; grid-template-columns: 1fr 320px; gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.eyebrow {
  font-size: 0.8rem; text-transform: uppercase; color: var(--brand-blue-light);
  margin-bottom: 1.3rem; display: inline-block;
}
.hero-text h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); letter-spacing: -0.02em; }
.hero-roles { color: var(--text-primary); font-weight: 700; margin: 0.7rem 0 1.5rem; font-size: 1.15rem; }
.hero-tagline { font-size: 1.18rem; max-width: 54ch; color: var(--text-primary); margin-bottom: 1rem; }
.hero-sub { color: var(--text-secondary); max-width: 52ch; margin-bottom: 2rem; font-style: italic; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.4rem; }
.track { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem 1rem; }
.track-label { font-size: 0.76rem; text-transform: uppercase; color: var(--text-muted); }
.track-orgs { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.track-org { font-family: var(--font-head); font-size: 1.05rem; color: var(--text-secondary); position: relative; }
.track-org:not(:last-child)::after { content: "·"; position: absolute; right: -0.6rem; color: var(--text-muted); }

.hero-aside { justify-self: end; align-self: center; }
.portrait { position: relative; width: 300px; max-width: 100%; }
.portrait::before {
  content: ""; position: absolute; inset: -10px -10px auto auto; width: 100%; height: 100%;
  border: 1px solid var(--brand-blue); z-index: 0;
}
.portrait img, .portrait-fallback {
  position: relative; z-index: 1; width: 100%; height: auto; aspect-ratio: 3 / 4;
  max-height: 420px; object-fit: cover; object-position: 50% 35%; display: block;
  background: var(--bg-card); filter: contrast(1.03) saturate(0.96);
}
.portrait-fallback {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 4.5rem; color: var(--brand-blue-light);
  border: 1px solid var(--border-light);
}
.portrait figcaption {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted);
  margin-top: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- Stats band ---------- */
.stats { background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.band-label {
  max-width: var(--maxw); margin: 0 auto; padding: 1.6rem clamp(1.1rem, 4vw, 2rem) 0;
  font-size: 0.76rem; text-transform: uppercase; color: var(--text-muted);
}
.stats-grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: 1rem clamp(1.1rem, 4vw, 2rem) 2.4rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.stat { border-left: 2px solid var(--border-light); padding-left: 1.1rem; }
.stat-fig { font-family: var(--font-head); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; color: var(--text-primary); }
.stat-fig .suffix { color: var(--brand-blue); }
.stat-label { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.6rem; line-height: 1.4; letter-spacing: 0; }

/* ---------- Offer ---------- */
.offer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.offer-card { background: var(--bg-primary); padding: 1.7rem; transition: background 0.2s; position: relative; }
.offer-card:hover { background: var(--bg-card-hover); }
.offer-card.entry { background: var(--bg-card); }
.offer-card.entry::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--brand-blue); }
.offer-badge {
  font-family: var(--font-mono); display: inline-block; color: var(--brand-blue);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.7rem;
}
.offer-card h3 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.offer-meta { color: var(--brand-blue-light); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.8rem; }
.offer-card p { color: var(--text-secondary); font-size: 0.98rem; }

/* ---------- Timeline / ledger ---------- */
.timeline { display: flex; flex-direction: column; }
.job {
  display: grid; grid-template-columns: 140px 1fr; gap: 1.6rem;
  padding: 1.5rem 0; border-top: 1px solid var(--border); position: relative;
}
.job:last-child { border-bottom: 1px solid var(--border); }
.job-period { color: var(--text-muted); font-size: 0.82rem; padding-top: 0.3rem; }
.job.current .job-period { color: var(--brand-blue-light); font-weight: 700; }
.job.current .job-period::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-blue); margin-right: 0.5rem; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(61,99,255,0.5); animation: pulse 2.4s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,99,255,0.5); } 70% { box-shadow: 0 0 0 7px rgba(61,99,255,0); } 100% { box-shadow: 0 0 0 0 rgba(61,99,255,0); } }
.job-role { font-family: var(--font-head); font-size: 1.2rem; }
.job-org { color: var(--text-secondary); font-weight: 700; margin-bottom: 0.5rem; }
.job-org .loc { color: var(--text-muted); font-weight: 400; }
.job-lead { color: var(--text-secondary); font-size: 0.97rem; margin-bottom: 0.6rem; max-width: 62ch; }
.job-note { color: var(--text-muted); font-size: 0.95rem; font-style: italic; margin-top: 0.6rem; max-width: 62ch; }
.job ul { list-style: none; }
.job li { color: var(--text-secondary); font-size: 0.96rem; padding-left: 1.2rem; position: relative; margin-bottom: 0.25rem; }
.job li::before { content: "—"; color: var(--brand-blue); position: absolute; left: 0; }

/* ---------- Proof ---------- */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 2.6rem; }
.case-card { background: var(--bg-primary); padding: 1.7rem; transition: background 0.2s; }
.case-card:hover { background: var(--bg-card-hover); }
.case-result { font-family: var(--font-head); font-size: 1.3rem; color: var(--text-primary); margin-bottom: 0.6rem; }
.case-desc { color: var(--text-secondary); font-size: 0.94rem; margin-bottom: 1rem; }
.case-quote { color: var(--brand-blue-light); font-style: italic; font-size: 0.95rem; }

.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.testimonial { background: var(--bg-secondary); border: 1px solid var(--border); padding: 1.5rem; transition: background 0.2s, border-color 0.2s; }
.testimonial:hover { border-color: var(--border-light); }
.testimonial:hover { background: var(--bg-card-hover); }
.testimonial p { font-family: var(--font-head); font-style: italic; font-size: 1.05rem; margin-bottom: 0.9rem; color: var(--text-primary); }
.testimonial .who { color: var(--brand-blue-light); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; }
.proof-subhead {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.78rem; color: var(--text-muted); margin: 2.6rem 0 1.2rem;
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--border);
}
/* Reserve space so the async carousel doesn't shift the page (CLS) */
.famewall-wrap { width: 100%; min-height: 340px; position: relative; }
.famewall-wrap iframe, .famewall-wrap .famewall-embed { position: relative; z-index: 1; }
.famewall-wrap iframe { width: 100% !important; border: none; }

/* ---------- Credentials (folded into contact head spacing if used) ---------- */
.cred-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cred-list li { border: 1px solid var(--border-light); padding: 0.45rem 1rem; font-size: 0.82rem; color: var(--text-secondary); }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--border); }
.contact-links { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.8rem; }
.contact-links a {
  color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.95rem;
  border-bottom: 1px solid var(--border-light); padding: 4px 0; transition: all 0.18s;
}
.contact-links a:hover { color: var(--brand-blue-light); border-color: var(--brand-blue); }
.contact-langs { color: var(--text-muted); font-size: 0.85rem; margin-top: 1.6rem; }
.signoff { display: block; height: 54px; width: auto; margin-top: 2.5rem; opacity: 0.85; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 2.2rem 1rem; color: var(--text-muted); font-size: 0.82rem; border-top: 1px solid var(--border); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* staggered hero load */
.hero .reveal.in { transition-delay: var(--d, 0s); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-aside { justify-self: start; order: -1; }
  .portrait { width: 170px; }
  .portrait img, .portrait-fallback { aspect-ratio: 3 / 4; }
  .offer-grid, .case-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 0.7rem; }
  .section-index { padding-top: 0; border-top: none; border-left: 2px solid var(--brand-blue); padding-left: 0.6rem; }
  .job { grid-template-columns: 1fr; gap: 0.4rem; }
  .job-period { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .job.current .job-period::before { animation: none; }
  .btn, .nav a::after { transition: none; }
}
