/* Kamrava.com — compact modern redesign */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #0f4c5c;
  --brand-dark: #0a3640;
  --accent: #c46b1f;
  --accent-soft: #fdf4eb;
  --paper: #ffffff;
  --soft: #f8fafc;
  --line: #e2e8f0;
  --focus: #f59e0b;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1100px;
  --header-h: 56px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 0.15em; transition: color 0.15s ease; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }
.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;
}

/* Header & Nav */
.site-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
}
.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.nav-toggle svg { display: block; width: 20px; height: 20px; }

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
nav a:hover,
nav a[aria-current="page"] {
  background: var(--soft);
  color: var(--brand-dark);
}

/* Typography */
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  margin: 0 0 0.4rem;
}
h1, h2, h3 { line-height: 1.2; margin-top: 0; font-weight: 750; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: 0.6rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.lead {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: var(--muted);
  max-width: 58ch;
  margin: 0 0 1rem;
}
p { margin: 0 0 0.85rem; }

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.button:hover { background: var(--brand-dark); color: #fff; }
.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.button.secondary:hover {
  background: var(--soft);
  color: var(--ink);
  border-color: #cbd5e1;
}

/* Layout sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1rem;
}
.section.soft { background: var(--soft); max-width: none; }
.section.soft > .inner,
.section.soft > .tree-card { max-width: var(--max); margin: 0 auto; }
.intro { margin-bottom: 1.5rem; max-width: 60ch; }
.intro p:last-child { margin-bottom: 0; }

/* Hero — full-bleed photographic backgrounds */
.hero,
.re-hero {
  position: relative;
  overflow: hidden;
  min-height: 52vh;
  background-color: #1a2332;
}
.hero::before,
.re-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}
/* Iran landscape fills the family hero */
.hero::before {
  background-image: url("./assets/images/iran-bg.jpg");
  opacity: 1;
}
/* Los Angeles skyline fills the real-estate hero */
.re-hero::before {
  background-image: url("./assets/images/la-skyline.jpg");
  opacity: 1;
}
/* Dark gradient only so text stays readable while photo remains visible */
.hero::after,
.re-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.72) 0%,
    rgba(15, 23, 42, 0.55) 42%,
    rgba(15, 23, 42, 0.25) 70%,
    rgba(15, 23, 42, 0.15) 100%
  );
  z-index: 0;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem 2.75rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 1.75rem;
}
/* Light text on photo heroes */
.hero .eyebrow,
.re-hero .eyebrow {
  color: #f6c177;
}
.hero h1,
.re-hero h1 {
  color: #fff;
}
.hero .lead,
.re-hero .lead {
  color: rgba(255, 255, 255, 0.88);
}
.hero .button.secondary,
.re-hero .button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.hero .button.secondary:hover,
.re-hero .button.secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.re-hero .stat strong {
  color: #fff;
}
.re-hero .stat span {
  color: rgba(255, 255, 255, 0.75);
}
.re-hero .stat {
  border-left-color: #f6c177;
}

/* Content photos — never crop */
.portrait {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  justify-self: start;
  background: transparent;
  object-fit: contain;
  display: block;
}
/* Real-estate hero: photo on the left */
.re-hero .portrait {
  justify-self: start;
}
/* Family homepage hero still puts photo on the right */
.hero .portrait {
  justify-self: end;
}
.re-hero .hero-grid {
  padding-bottom: 2.5rem;
  grid-template-columns: 0.85fr 1.15fr;
}

/* Gallery — show complete photos (no cropping) */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.85rem;
}
.figure {
  grid-column: span 4;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.figure.wide { grid-column: span 8; }
.figure img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: var(--soft);
  display: block;
}
.figure figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Tree card teaser */
.tree-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.tree-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* Cards & stats */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.stat {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
}
.stat strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}
.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Profile */
.profile {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 1.75rem;
  align-items: center;
}
.profile img {
  width: min(100%, 320px);
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: var(--soft);
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.25rem;
  padding: 0;
  list-style: none;
  margin: 1rem 0 0;
}
.checks li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.92rem;
}
.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

/* Contact band */
.contact-band {
  background: var(--brand);
  color: #fff;
}
.contact-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.contact-band a { color: #fff; }
.contact-band .button {
  background: #fff;
  color: var(--brand);
}
.contact-band .button:hover {
  background: var(--accent-soft);
  color: var(--brand-dark);
}
.contact-band strong { display: block; margin-bottom: 0.15rem; }
.contact-band p { margin: 0; opacity: 0.9; font-size: 0.95rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); }

/* Notice */
.notice {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}
.notice code {
  font-size: 0.85em;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Family-tree viewer */
.tree-page { max-width: 1400px; padding-top: 1.5rem; }
.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.15rem 0 0.85rem;
}
.tree-control { font: inherit; cursor: pointer; }
.tree-viewer {
  width: 100%;
  min-height: 320px;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.75rem;
  overscroll-behavior: contain;
}
.tree-viewer:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.tree-viewer img {
  width: 100%;
  max-width: none;
  height: auto;
  transition: width 0.15s ease;
}
.viewer-help {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.65rem;
}

/* Responsive — tablet & mobile */
@media (max-width: 860px) {
  .hero-grid,
  .profile,
  .tree-card {
    grid-template-columns: 1fr;
  }
  .portrait {
    justify-self: start;
    max-width: 280px;
  }
  .hero .portrait {
    justify-self: start;
  }
  .cards,
  .stats {
    grid-template-columns: 1fr;
  }
  .figure,
  .figure.wide {
    grid-column: span 12;
  }
  .checks { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --header-h: auto; }
  .nav-toggle { display: block; }
  nav {
    display: none;
    width: 100%;
    padding-bottom: 0.6rem;
  }
  nav.is-open { display: block; }
  .nav-wrap {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
  nav ul {
    flex-direction: column;
    gap: 0.15rem;
  }
  nav a {
    display: block;
    padding: 0.55rem 0.75rem;
  }
  .hero-grid { padding: 1.5rem 1rem 1.75rem; }
  .section { padding: 1.75rem 1rem; }
  .tree-toolbar .button { flex: 1 1 auto; text-align: center; }
  .tree-viewer { min-height: 260px; padding: 0.4rem; }
  .contact-grid { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header, .actions, .contact-band, .nav-toggle { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: none; }
}
