/* cemgokmen.com — cards layout, Cardinal palette (neutral stone + Stanford red).
   All colors are tokens in :root below. */

:root {
  --bg: #f4f3f1;
  --surface: #fbfbfa;
  --surface-hover: #ffffff;
  --line: #e4e1dd;
  --line-strong: #d3cec8;
  --text: #262322;
  --text-2: #57514d;
  --text-3: #86807a;
  --accent: #8c1515;          /* Stanford cardinal */
  --accent-ink: #6f1010;
  --accent-tint: #f3e2e0;
  --accent-tint-2: #ebcfcc;
  --pill: #ebe8e4;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --max: 880px;
  --gutter: 28px;
  --shadow: 0 1px 2px rgba(40, 30, 30, .04), 0 2px 8px rgba(40, 30, 30, .03);
  --shadow-hover: 0 2px 4px rgba(40, 30, 30, .05), 0 10px 24px rgba(40, 30, 30, .07);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
img { display: block; max-width: 100%; }

a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease, background-color .15s ease, border-color .15s ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 40px 0 0;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
}
.site-name:hover { color: var(--text); }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  font-size: .9rem;
  color: var(--text-2);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  align-items: start;
  padding-top: 56px;
}
.intro-text { display: grid; gap: 14px; color: var(--text-2); }
.intro-text p:not(.intro-role) { font-size: 1.02rem; }
.intro-role {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.portrait {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 32px;
  background: var(--pill);
  box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--line), var(--shadow-hover);
  margin-top: 6px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin-top: 26px;
  font-size: .92rem;
}
.profile-links li { display: flex; align-items: center; }
.profile-links li + li::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  margin: 0 14px;
}
.profile-links a { color: var(--text); text-decoration: none; font-weight: 500; }
.profile-links a:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding-top: 80px; scroll-margin-top: 24px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.section-note { font-size: .88rem; color: var(--text-3); }
.subhead {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 56px 0 6px;
  scroll-margin-top: 24px;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.pill--link {
  background: var(--pill);
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid transparent;
}
.pill--link:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--accent-ink);
}
.pill--venue {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
}
.pill--award {
  background: var(--accent-tint-2);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ---------- Research cards ---------- */
.cards { display: grid; gap: 16px; }
.card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.teaser {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.teaser::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.2px);
  background-size: 10px 10px;
  mix-blend-mode: soft-light;
}
.teaser span {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .92);
  position: relative;
  z-index: 1;
}
.teaser--a { background: linear-gradient(135deg, #c27a72, #8c1515); }
.teaser--b { background: linear-gradient(135deg, #a8a29a, #625b53); }
.teaser--c { background: linear-gradient(135deg, #b38a86, #6e3f3b); }
.teaser--d { background: linear-gradient(135deg, #c2ad8f, #85704f); }
.teaser--e { background: linear-gradient(135deg, #8f9a99, #4f5a59); }
.teaser--f { background: linear-gradient(135deg, #b9928b, #7d4f47); }

.card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 2px 4px 2px 0; }
.card-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.card-title {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.005em;
  color: var(--text);
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.teaser--img { width: 100%; height: auto; object-fit: cover; display: block; background: var(--pill); }
.news-item[hidden] { display: none; }
.section-head + .news { margin-top: -8px; }
.news .news-item:first-child { padding-top: 0; }
.badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.card-blurb { font-size: .9rem; line-height: 1.6; color: var(--text-2); }
.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.card-role {
  font-size: .78rem;
  color: var(--text-3);
  font-style: italic;
  margin-left: 6px;
}

/* ---------- All publications ---------- */
.pubs-note { font-size: .8rem; color: var(--text-3); margin-bottom: 10px; }
.pub {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub-title { font-size: .95rem; font-weight: 600; line-height: 1.45; color: var(--text); }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font-size: .85rem; line-height: 1.55; color: var(--text-2); margin-top: 3px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: .82rem; color: var(--text-3); margin-top: 3px; font-style: italic; }
.pub-award {
  display: inline-block;
  font-style: normal;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-tint);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}

/* ---------- News ---------- */
.news { display: grid; }
.news-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .95rem;
}
.news-item:last-child { border-bottom: 0; }
.news-date {
  font-size: .82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  padding-top: 2px;
}
.news.is-collapsed .news-item:nth-child(n + 5) { display: none; }
.news.is-collapsed .news-item:nth-child(4) { border-bottom: 0; }

.toggle {
  margin-top: 14px;
  font: 500 .85rem/1 var(--sans);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.toggle:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--surface-hover); }
.toggle::after { content: " ↓"; }
.toggle[aria-expanded="true"]::after { content: " ↑"; }

/* ---------- Timeline ---------- */
.timeline { display: grid; }
.tl-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: 0; }
.tl-org { font-weight: 600; font-size: .98rem; color: var(--text); line-height: 1.45; }
.tl-sub { font-weight: 400; color: var(--text-3); font-size: .88rem; margin-left: 4px; }
.tl-role { font-size: .88rem; color: var(--text-2); margin-top: 2px; line-height: 1.55; }
.tl-date {
  font-size: .85rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 96px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--text-3);
}
.site-footer a { color: var(--text-3); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .portrait { order: -1; width: 152px; height: 152px; border-radius: 24px; margin-top: 0; }
  .card { grid-template-columns: 132px 1fr; gap: 16px; padding: 14px; }
  .section { padding-top: 64px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .site-header { padding-top: 28px; }
  .site-nav { gap: 16px; }
  .section h2 { font-size: 1.5rem; }
  .card { grid-template-columns: 1fr; }
  .teaser { aspect-ratio: 16 / 7; }
  .card-top { grid-template-columns: 1fr; gap: 8px; }
  .badges { flex-direction: row; flex-wrap: wrap; align-items: center; order: -1; }
  .card-body { padding: 0; }
  .tl-item { grid-template-columns: 1fr; gap: 2px; }
  .tl-date { order: -1; font-size: .78rem; }
  .news-item { grid-template-columns: 52px 1fr; gap: 12px; }
  .profile-links li + li::before { margin: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card:hover { transition: none; transform: none; }
}

/* ---------- Blog & standalone pages ---------- */
.prose-page { padding: 56px 0 24px; max-width: 700px; }
.post-head { margin-bottom: 28px; }
.post-meta { font-size: .85rem; color: var(--text-3); margin-bottom: 10px; }
.post-meta a { color: var(--text-3); }
.post-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--text);
}
.prose { color: var(--text-2); line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); font-weight: 600; color: var(--text); line-height: 1.3; margin-top: 1.8em; }
.prose h1 { font-size: 1.65rem; }
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose blockquote { border-left: 3px solid var(--accent-tint-2); padding-left: 1em; color: var(--text-3); }
.prose code { font: .88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--pill); padding: .1em .35em; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; line-height: 1.55; }
.prose pre code { display: block; background: none; padding: 0; font-size: .84rem; line-height: inherit; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; }

.blog-index { padding-top: 56px; }
.post-list { display: grid; }
.post-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.post-item-title { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.post-item-title a { color: var(--text); text-decoration: none; }
.post-item-title a:hover { color: var(--accent-ink); }
.post-item-excerpt { margin-top: 6px; font-size: .9rem; color: var(--text-2); line-height: 1.6; }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 24px; }

@media (max-width: 560px) {
  .post-item { grid-template-columns: 1fr; gap: 4px; }
  .prose-page, .blog-index { padding-top: 36px; }
}
