/* ==========================================================================
   Suleyman Kiroglu — site styles
   One stylesheet for every page. Plain CSS, no build step.

   Type:   Source Serif 4 (reading text) + Inter (navigation, labels)
   Layout: a two-column section grid — lowercase label | prose column —
           that collapses to a single column on narrow screens.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  --bg:      #fcfcfa;
  --ink:     #1b1b1b;
  --ink-soft:#3d3d3d;   /* 10.6:1 on --bg */
  --muted:   #5c5c5c;   /* 6.4:1 on --bg */
  --rule:    #e3e1dc;
  --accent:  #1f5a5e;   /* deep teal, 7.6:1 on --bg */

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --label-col: 14rem;
  --prose-col: 40rem;
  --col-gap:   clamp(2rem, 6vw, 5rem);
  --gutter:    clamp(1rem, 4vw, 2.5rem);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

strong { font-weight: 600; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

main { flex: 1 0 auto; width: 100%; }

.wrap {
  max-width: calc(var(--label-col) + var(--col-gap) + var(--prose-col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- header ---------- */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.wordmark {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* ---------- page head & sections ---------- */

.page-head,
.section {
  display: grid;
  grid-template-columns: minmax(0, var(--label-col)) minmax(0, var(--prose-col));
  column-gap: var(--col-gap);
}

.page-head {
  padding-top: clamp(2.25rem, 6vw, 4.75rem);
  padding-bottom: clamp(1.75rem, 4.25vw, 3rem);
}

.page-head h1 {
  grid-column: 1 / -1;
  margin: 0 0 clamp(1.1rem, 2.6vw, 1.75rem);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.page-head .lede { grid-column: 2; }

.lede {
  font-size: 1.1875em;
  line-height: 1.55;
}

.section {
  padding-top: clamp(2.25rem, 5vw, 3.85rem);
  padding-bottom: clamp(2.25rem, 5vw, 3.85rem);
  border-top: 1px solid var(--rule);
}

.section > h2 {
  margin: 0;
  padding-top: 0.1rem;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-body { min-width: 0; }

.section-body h3 {
  margin: 2rem 0 0.6rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.section-body > h3:first-child { margin-top: 0; }

.more {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

/* ---------- home intro ---------- */

.intro .portrait {
  grid-column: 1;
  align-self: start;
  max-width: 11.5rem;
  margin: 0.4rem 0 0;
}
.intro .portrait img { width: 100%; }

.intro .lede { grid-column: 2; }

.quick-links {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- research ---------- */

.related {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375em;
  color: var(--muted);
}
.related li { position: relative; margin: 0 0 0.4rem; padding-left: 1.5em; }
.related li::before { content: "\2192"; position: absolute; left: 0; color: var(--muted); }

/* ---------- publications ---------- */

.year {
  margin: 2.25rem 0 0.9rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.section-body > .year:first-child { margin-top: 0.35rem; }

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub { margin: 0 0 1.6rem; }
.pub:last-child { margin-bottom: 0; }

.pub-title {
  margin: 0;
  font-size: 1.0625em;
  font-weight: 600;
  line-height: 1.38;
}

.pub-authors,
.pub-venue {
  margin: 0.2rem 0 0;
  font-size: 0.9375em;
  line-height: 1.5;
}
.pub-authors { color: var(--ink-soft); }
.pub-venue   { color: var(--muted); }

.pub-authors .me { color: var(--ink); font-weight: 600; }

.pub-links {
  margin: 0.3rem 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
}
.pub-links a { margin-right: 0.9rem; }

.status {
  margin: 0.3rem 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
}

/* working papers: lighter title weight and a status line */
.pubs.working .pub-title { font-weight: 400; }

/* ---------- cv & teaching entries ---------- */

.cites {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cites li {
  margin: 0 0 0.85rem;
  padding-left: 1.25em;
  text-indent: -1.25em;
  line-height: 1.55;
}
.cites li:last-child { margin-bottom: 0; }
.cites .me { font-weight: 600; }

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry { margin: 0 0 1.4rem; }
.entry:last-child { margin-bottom: 0; }

.entry-title { margin: 0; font-weight: 600; line-height: 1.4; }
.entry-meta  { margin: 0.15rem 0 0; color: var(--muted); line-height: 1.5; }
.nowrap { white-space: nowrap; }
.entry-meta + .dated { margin-top: 0.9rem; }

.dated {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dated li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.45;
}
.dated li:first-child { padding-top: 0; }
.dated li:last-child  { border-bottom: 0; padding-bottom: 0; }
.dated .when {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.15em;
}

/* ---------- contact ---------- */

.contact-list { margin: 0; }
.contact-list div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.contact-list div:first-child { padding-top: 0; }
.contact-list div:last-child  { border-bottom: 0; }
.contact-list dt {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  padding-top: 0.15em;
}
.contact-list dd { margin: 0; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: clamp(1.5rem, 5vw, 3.25rem);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2.25rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- narrow screens ---------- */

@media (max-width: 52rem) {
  .page-head,
  .section { grid-template-columns: minmax(0, 1fr); }

  .page-head .lede,
  .intro .lede { grid-column: 1; }

  .section > h2 {
    margin-bottom: 0.9rem;
    font-size: 1.0625rem;
  }

  .intro .portrait {
    grid-column: 1;
    max-width: 9.5rem;
    margin: 0 0 1.4rem;
  }
}

@media (max-width: 30rem) {
  .site-header .wrap { padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .site-nav ul { gap: 0 1.15rem; }
  .site-nav a { padding: 0.5rem 0; }
  .contact-list div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .dated li { gap: 1rem; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; font-size: 11pt; }
  .section { border-top-color: #ccc; }
  a { color: inherit; text-decoration: none; }
}
