/* ==========================================================================
   Dr. Irem Sonmez — sonmezmd.com
   Mediterranean soul, a sprinkle of futurism.
   ========================================================================== */

:root {
  /* Palette: sun-warmed stone, sea & sky, terracotta, olive */
  --stone-50:  #faf7f2;
  --stone-100: #f3eee5;
  --stone-200: #e7dfd2;
  --sea-900:   #14333f;
  --sea-800:   #1d4a5a;
  --sea-700:   #256175;
  --sea-600:   #2e7891;
  --terra-600: #b45f43;
  --terra-700: #9d4f36;
  --olive-600: #6f7d5c;
  --ink:       #23292c;
  --ink-soft:  #4c565c;

  --font-serif: "Iowan Old Style", "Palatino Nova", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 51, 63, 0.05), 0 8px 28px rgba(20, 51, 63, 0.08);
  --hairline: 1px solid rgba(29, 74, 90, 0.14);
  --maxw: 1100px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--stone-50);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sea-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terra-600); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; color: var(--sea-900); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--sea-700), var(--sea-800));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--sea-600), var(--sea-700)); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--sea-800);
  border-color: rgba(29, 74, 90, 0.35);
}
.btn-ghost:hover { border-color: var(--terra-600); color: var(--terra-600); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--hairline);
}
.nav nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sea-900);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-brand span { color: var(--terra-600); font-size: 0.85rem; font-weight: 600; margin-left: 0.35rem; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a { text-decoration: none; font-weight: 500; font-size: 0.98rem; color: var(--ink-soft); }
.nav-menu a:hover { color: var(--terra-600); }
.nav-cta {
  background: linear-gradient(135deg, var(--sea-700), var(--sea-800));
  color: #fff !important;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}
.nav-cta:hover { opacity: 0.92; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(46, 120, 145, 0.14), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(180, 95, 67, 0.10), transparent 60%),
    linear-gradient(180deg, var(--stone-50) 0%, var(--stone-100) 100%);
}
.hero::after { /* fine hairline horizon — the sprinkle of futurism */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(29,74,90,.35), transparent);
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 3rem;
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra-600);
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  margin: 0 0 1rem;
}
.hero-creds {
  display: inline-block;
  margin-left: 0.75rem;
  font-size: 0.45em;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--olive-600);
  letter-spacing: 0.08em;
  vertical-align: 0.5em;
}
.hero-lead { font-size: 1.25rem; font-family: var(--font-serif); color: var(--sea-800); margin: 0 0 0.75rem; }
.hero-text p { margin: 0 0 0.85rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-photo { margin: 0; position: relative; }
.hero-photo img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 4px solid #fff;
}
.hero-photo::before { /* offset frame */
  content: "";
  position: absolute;
  inset: 1rem -1rem -1rem 1rem;
  border: 1px solid rgba(180, 95, 67, 0.35);
  border-radius: var(--radius);
  z-index: -1;
}

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-alt {
  background: linear-gradient(180deg, var(--stone-100), var(--stone-50));
  border-top: var(--hairline);
  border-bottom: var(--hairline);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1.2rem;
  position: relative;
  padding-bottom: 0.7rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 56px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--terra-600), var(--sea-600));
}
.section-intro { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; margin: 0 0 2.2rem; }
.section-outro { margin-top: 2.4rem; font-size: 1.1rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3.5rem;
  margin-top: 1.5rem;
}
.about-col h3 {
  font-size: 1.3rem;
  margin: 1.6rem 0 0.6rem;
  color: var(--terra-700);
}
.about-col h3:first-child { margin-top: 0; }
.about-col p { margin: 0 0 0.9rem; }

/* ---------- Services cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  border: var(--hairline);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.6rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(20,51,63,.06), 0 16px 40px rgba(20,51,63,.12);
}
.card h3 { font-size: 1.25rem; margin: 0.9rem 0 0.7rem; }
.card p { margin: 0 0 0.8rem; color: var(--ink-soft); font-size: 0.99rem; }
.card-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--sea-700);
  background: linear-gradient(135deg, rgba(46,120,145,.12), rgba(180,95,67,.10));
  border: 1px solid rgba(29,74,90,.15);
}
.card-icon svg { width: 24px; height: 24px; }
.badge {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--terra-700);
  background: rgba(180, 95, 67, 0.12);
  border: 1px solid rgba(180, 95, 67, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

/* ---------- Research ---------- */
.research-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem 2rem;
  margin-bottom: 2rem;
}
.research-intro p { max-width: 58ch; margin: 0; }
.pub-wrap h3 { font-size: 1.25rem; color: var(--terra-700); margin: 2rem 0 1rem; }
.pub-wrap h3:first-child { margin-top: 0; }
.pub-list {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.85rem;
  font-size: 0.96rem;
  color: var(--ink-soft);
}
.pub-list em { color: var(--ink); font-style: italic; }
.pub-link { white-space: nowrap; font-weight: 600; }
/* collapsed state: show first 5 */
#pub-list.collapsed > li:nth-child(n+6) { display: none; }
.pub-toggle { margin-top: 1.2rem; }

/* ---------- Essays ---------- */
.essays { display: grid; gap: 1.2rem; max-width: 800px; }
.essay {
  background: #fff;
  border: var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
}
.essay h3 { margin: 0; }
.essay-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--sea-900);
  text-align: left;
  cursor: pointer;
}
.essay-toggle:hover { color: var(--terra-600); }
.essay-chevron {
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .25s ease;
  margin-top: -4px;
}
.essay-toggle[aria-expanded="true"] .essay-chevron { transform: rotate(-135deg); margin-top: 4px; }
.essay-teaser { color: var(--ink-soft); margin: 0.7rem 0 0; }
.essay-body { border-top: var(--hairline); margin-top: 1rem; padding-top: 0.4rem; }
.essay-body p { margin: 0.8rem 0; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  margin-top: 1.5rem;
}
.contact-lead { font-family: var(--font-serif); font-size: 1.3rem; color: var(--sea-800); margin: 0 0 0.8rem; }
.contact-details {
  list-style: none;
  margin: 1.6rem 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.contact-details li { display: grid; gap: 0.15rem; }
.contact-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra-600);
}
.contact-note { color: var(--ink-soft); font-size: 0.95rem; }

.contact-form {
  background: #fff;
  border: var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.7rem;
}
.form-privacy {
  font-size: 0.93rem;
  color: var(--ink-soft);
  background: var(--stone-100);
  border-left: 3px solid var(--olive-600);
  border-radius: 0 8px 8px 0;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.3rem;
}
.form-field { margin-bottom: 1.1rem; display: grid; gap: 0.3rem; }
.form-field label { font-weight: 600; font-size: 0.95rem; color: var(--sea-900); }
.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--stone-50);
  border: 1px solid rgba(29, 74, 90, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  width: 100%;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--sea-600);
  outline-offset: 1px;
  border-color: var(--sea-600);
}
.form-status { margin-top: 1rem; font-weight: 600; color: var(--olive-600); }

/* ---------- Footer ---------- */
.footer {
  background: var(--sea-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.6rem 0;
  font-size: 0.95rem;
}
.footer-name { font-family: var(--font-serif); font-size: 1.1rem; color: #fff; margin: 0 0 1rem; }
.footer-crisis { max-width: 75ch; margin: 0 0 1rem; line-height: 1.65; }
.footer-crisis strong { color: #ffd9c9; }
.footer-copy { margin: 0; color: rgba(255, 255, 255, 0.55); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn, .essay-chevron { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 3rem; }
  .hero-photo { max-width: 340px; }
  .cards { grid-template-columns: 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
  }
  .nav-toggle span {
    width: 22px; height: 2px;
    background: var(--sea-900);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--stone-50);
    border-bottom: var(--hairline);
    box-shadow: var(--shadow);
    display: none;
    padding: 0.5rem 0;
  }
  .nav-menu.open { display: flex; }
  .nav-menu li a { display: block; padding: 0.85rem 1.5rem; }
  .nav-cta { border-radius: 0; background: none; color: var(--terra-600) !important; font-weight: 700; }

  .section { padding: 3.2rem 0; }
  body { font-size: 1rem; }
}
