/* ===========================================================
   Dr. Ofir Hakim — Scientific Due Diligence & R&D Advisory
   Global stylesheet. Colors and type direction are locked
   decisions (see project doc: positioning_and_market_research.md).
   =========================================================== */

:root {
  --bg: #0A0E16;          /* navy-tinted near-black — locked */
  --bg-raised: #10161F;   /* slightly lighter panel background */
  --accent: #1F7A4D;      /* forest emerald — locked */
  --accent-hover: #26925C;
  --text: #F3F5F4;        /* near-white body/heading text */
  --text-muted: #9BA5AF;  /* secondary/supporting text */
  --border: #202836;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gap-section: 48px;    /* max gap between stacked sections, per QA doc */
  --gap-cta: 64px;        /* gap around closing CTA sections, per QA doc */
  --page-max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

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

/* ---------- Type scale ---------- */

h1, .h1 {
  font-size: 44px;
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  text-wrap: balance; /* prevents orphan words like a lone "It" on their own line, at any screen width */
}

h2, .h2 {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h3, .h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.subhead {
  font-size: 18px;
  line-height: 1.5;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 16px;
}

p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 14px;
}

p.lead {
  font-size: 19px;
  color: var(--text);
}

@media (max-width: 640px) {
  h1, .h1 { font-size: 32px; }
  h2, .h2 { font-size: 24px; }
  h3, .h3 { font-size: 18px; }
  p { font-size: 16px; }
  p.lead { font-size: 17px; }
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }

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

.btn-secondary:hover { border-color: var(--accent); background: transparent; }

/* ---------- Sections & layout ---------- */

/* Vertical rhythm: main is a single flex column with one fixed gap between
   sections. This is deliberate — giving every section its own top AND
   bottom padding was the "compounding padding" bug flagged during the
   Framer build (48px + 48px = 96px between sections instead of 48px).
   A single gap value guarantees the real on-screen gap always matches
   the intended one, with no double-counting. */
main.wrap {
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
}

section {
  padding: 0;
}

section.cta-section {
  margin-top: 16px; /* 48px gap + 16px = 64px total before the CTA, per the "gap around closing CTA sections" rule */
}

.hero {
  padding: 88px 0 0;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-photo {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  justify-self: center;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 32px;
    text-align: left;
  }
  .hero-photo { order: -1; max-width: 220px; margin-bottom: 8px; justify-self: start; }
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

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

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.card h2, .card h3 {
  color: var(--accent);
}

.card h2 u, .card h3 u { text-decoration: none; }

/* Clickable section headings (e.g. home page teasers linking to their
   full pages) — underline only on hover so it doesn't read as a link
   by default, but is discoverable. */
.heading-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.about-photo {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  align-items: start;
}

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

.meta-line {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}

.cta-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
}

.cta-box h2 { margin-bottom: 12px; }
.cta-box p { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------- Contact form ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}

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

.contact-info a {
  color: var(--accent);
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

input, textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.field { margin: 0; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: var(--gap-cta);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--accent); }
