/* ===========================================================================
   aybikemergen.com — design system
   "warm academic editorial": typographic foundation, pine accent on warm paper,
   colour concentrated in the research/visual cards.
   =========================================================================== */

:root {
  /* palette */
  --pine:        #1F4D3A;
  --pine-deep:   #143026;
  --pine-bright: #2E7D5B;
  --sage:        #E8F0EA;
  --sage-line:   #d4e2d8;
  --paper:       #FAF8F3;
  --paper-card:  #FFFFFF;
  --ink:         #1A1A1A;
  --muted:       #5A5F5A;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --maxw: 64rem;       /* page container */
  --measure: 42rem;    /* readable text column */
  --radius: 8px;
  --portrait-radius: 16px;
  --shadow: 0 1px 2px rgba(20,48,38,.05), 0 12px 28px -16px rgba(20,48,38,.28);
  --shadow-soft: 0 1px 2px rgba(20,48,38,.04);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--pine-deep); }
:focus-visible { outline: 2px solid var(--pine-bright); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; color: var(--pine-deep); letter-spacing: 0; }
h2 { font-size: 2.1rem; margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; }
p { margin: 0 0 1.1em; }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.measure { max-width: var(--measure); }
.eyebrow { font-family: var(--font-body); font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: uppercase; color: var(--pine-bright); margin: 0 0 .9rem; }
.lead { font-size: 1.2rem; color: #34453d; }
.section { padding: clamp(3rem, 2rem + 5vw, 5.5rem) 0; }
.section--tint { background: linear-gradient(var(--sage), var(--sage)); }
.hr { height: 1px; background: var(--sage-line); border: 0; margin: 0; }
.page-header { margin-bottom: 2.5rem; }
.page-title { font-size: 2.8rem; margin: 0; max-width: 20ch; }
.page-title--compact { max-width: 18ch; }
.page-intro { margin-top: 1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.section-top { margin-top: 2.5rem; }
.section-top-sm { margin-top: 2rem; }
.link-row { margin-top: 2.5rem; }
.spaced-top { margin-top: 1.5rem; }
.spaced-top-sm { margin-top: 1.25rem; }
.page-note { margin-top: .75rem; }
.rule-spaced { margin: 2.25rem 0; }
.flush { margin: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 560px) {
  h2 { font-size: 1.65rem; }
  .lead { font-size: 1.12rem; }
  .page-title { font-size: 2.15rem; }
}

/* ---------- skip link ---------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--pine); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,243,.86);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--sage-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--pine-deep); text-decoration: none; letter-spacing: 0; }
.brand:hover { color: var(--pine); }
.site-nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.site-nav a { font-size: .95rem; color: #2c3a33; text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--pine); }
.site-nav a[aria-current="page"] { color: var(--pine); border-bottom-color: var(--pine); }
.nav-toggle {
  display: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--paper);
  border: 1px solid var(--sage-line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--pine-deep);
}
.nav-toggle:hover { border-color: var(--pine); }
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  content: "";
  transition: transform .15s ease, opacity .15s ease;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; top: -.38rem; left: 0; }
.nav-toggle-icon::after { position: absolute; top: .38rem; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(.38rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-.38rem) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: grid; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--sage-line); box-shadow: var(--shadow-soft); padding: .35rem 0; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .72rem 1.25rem; width: 100%; border-bottom: none; }
  .site-nav a[aria-current="page"] { background: var(--sage); }
  .header-inner { position: relative; }
}

/* ---------- hero ---------- */
.hero { position: relative; }
.hero-art {
  background: var(--sage) url("/assets/hero.webp") right center / cover no-repeat;
  min-height: clamp(360px, 52vh, 560px);
  display: flex; align-items: center;
}
.hero-art::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper) 30%, rgba(250,248,243,.78) 48%, rgba(250,248,243,.15) 70%, transparent 88%);
}
.hero-copy { position: relative; padding: 2rem 0; max-width: 34rem; }
.hero h1 { font-size: 4rem; margin: 0 0 .5rem; color: var(--pine-deep); }
.hero .role { font-size: 1rem; color: var(--muted); margin: 0 0 1.25rem; font-weight: 500; }
.hero .tagline { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; font-style: italic; color: #2c4339; line-height: 1.4; margin: 0 0 1.6rem; }
@media (max-width: 560px) {
  .hero-art::before { background: linear-gradient(180deg, rgba(250,248,243,.55) 0%, rgba(250,248,243,.82) 55%, var(--paper) 100%); }
  .hero h1 { font-size: 2.7rem; }
  .hero .tagline { font-size: 1.2rem; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; text-decoration: none; padding: .7rem 1.2rem; border-radius: 8px; transition: transform .12s ease, background .15s ease; }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { color: var(--pine); border: 1px solid var(--sage-line); background: var(--paper-card); }
.btn-ghost:hover { border-color: var(--pine); color: var(--pine-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- cards (research themes) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.4rem; }
.cards--wide { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.card { background: var(--paper-card); border: 1px solid var(--sage-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); transition: transform .15s ease, box-shadow .2s ease; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.card:hover, .card:focus-within { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: var(--sage); }
.card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card-body h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 820px) { .about-grid { grid-template-columns: 1fr 19rem; align-items: start; } }
.about-media { display: grid; gap: 1.25rem; }
.about-texture { width: 100%; border-radius: var(--radius); border: 1px solid var(--sage-line); box-shadow: var(--shadow-soft); }
.portrait { width: 100%; max-width: 19rem; border-radius: var(--portrait-radius); border: 1px solid var(--sage-line); box-shadow: var(--shadow-soft); }
.aside-card { background: var(--paper-card); border: 1px solid var(--sage-line); border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.aside-card h3 { font-size: 1.05rem; }
.aside-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .95rem; }

/* ---------- publication / talks lists ---------- */
.pub-group { margin-bottom: 2.5rem; }
.pub-group h2 { padding-bottom: .4rem; border-bottom: 1px solid var(--sage-line); }
.pub-list, .talk-list { list-style: none; margin: 0; padding: 0; }
.pub-list li, .talk-list li { padding: 1rem 0; border-bottom: 1px solid var(--sage-line); padding-left: 1.4rem; text-indent: -1.4rem; }
.pub-list li:last-child, .talk-list li:last-child { border-bottom: 0; }
.pub-list .me, .talk-list .me { font-weight: 600; color: var(--pine-deep); }
.pub-venue { font-style: italic; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: 0; text-transform: uppercase; color: var(--pine-bright); background: var(--sage); border-radius: 999px; padding: .12rem .55rem; margin-left: .4rem; text-indent: 0; vertical-align: .08em; }
.talk-list .when { font-weight: 600; color: var(--pine-deep); }
.pub-list a, .talk-list a, .contact-links a { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .pub-list li, .talk-list li { padding-left: 0; text-indent: 0; }
}

/* ---------- writing feed ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.4rem; }
.post { background: var(--paper-card); border: 1px solid var(--sage-line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .2s ease; }
.post:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post .date { font-size: .82rem; color: var(--muted); margin: 0 0 .5rem; }
.post h3 { margin: 0 0 .5rem; font-size: 1.18rem; }
.post h3 a { text-decoration: none; }
.post p { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.post .more { margin-top: auto; font-weight: 600; font-size: .9rem; text-decoration: none; }
.feed-status { color: var(--muted); }

/* ---------- cv ---------- */
.cv-row { display: grid; grid-template-columns: 1fr; gap: .15rem; padding: .85rem 0; border-bottom: 1px solid var(--sage-line); }
@media (min-width: 640px) { .cv-row { grid-template-columns: 9rem 1fr; gap: 1.5rem; } }
.cv-row .when { color: var(--muted); font-size: .92rem; font-weight: 500; }
.cv-row .what strong { color: var(--pine-deep); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.chips li { background: var(--sage); color: var(--pine-deep); border-radius: 8px; padding: .25rem .6rem; font-size: .85rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--pine-deep); color: #d9e6dd; margin-top: 4rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding: 2.2rem 0; }
.site-footer a { color: #eaf3ed; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .92rem; }
.footer-note { font-size: .85rem; color: #9fb6a7; }

/* ---------- misc ---------- */
.contact-links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; }
.contact-links a { font-weight: 500; }
.note { font-size: .9rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
