/* ----------------------------
   barisyildirim.com – global stylesheet
   ---------------------------- */

:root {
  --bg: #faf8f4;
  --fg: #1d1b18;
  --muted: #6f6a62;
  --faint: #a29c92;
  --rule: #e6e0d6;
  --rule-strong: #d3cbbf;
  --card: #fffdf9;
  --soft: #f3efe8;
  --accent: #a8471f;
  --accent-soft: #f7e6dc;
  --hl: #f3d2c1;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --greek: Palatino, "Palatino Linotype", "GFS Didot", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wide: 62rem;
  --measure: 40rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --fg: #ece8e1;
    --muted: #a39d93;
    --faint: #6f6a62;
    --rule: #2b2824;
    --rule-strong: #3d3934;
    --card: #1b1917;
    --soft: #201e1b;
    --accent: #e39068;
    --accent-soft: #35231a;
    --hl: #5a3322;
  }
}

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

/* Layout */
body {
  margin: 0;
  padding: 0 1.25rem;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wide); margin: 0 auto; }
.wrap.narrow { max-width: var(--measure); }

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

a:hover,
a:focus-visible { text-decoration-color: currentColor; }

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

/* Type */
h1, h2, h3 { line-height: 1.2; color: var(--fg); font-weight: 600; }
h1 { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 2.9rem); letter-spacing: -0.015em; margin: 0 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; }

ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

.muted { color: var(--muted); }

.lede { font-size: 1.2rem; line-height: 1.55; }
.facts { color: var(--muted); font-size: 0.9375rem; margin-bottom: 2rem; }

/* Mono details */
.kicker,
.label,
.chip,
.tags,
.date,
.site-footer { font-family: var(--mono); }

.kicker {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

/* Top navigation */
.topnav {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
  font-size: 0.9375rem;
}
.topnav .home { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--fg); text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--fg); }

/* Home: hero */
.hero { padding: 1.5rem 0 0.5rem; }
.hero .lede {
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  line-height: 1.4;
  max-width: 34rem;
  margin-bottom: 1.25rem;
}
.hero p { max-width: var(--measure); }
.now { font-size: 0.9375rem; color: var(--muted); }
.now strong { color: var(--accent); font-weight: 600; }

.contact,
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.contact { margin: 1.25rem 0 0; font-size: 0.9375rem; }

/* Section labels */
.label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 4.5rem 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

/* Work grid */
.work-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--rule-strong); }

.cover {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--soft);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.card .cover { border-bottom: 1px solid var(--rule); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.card-body { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; padding: 1.25rem 1.35rem 1.4rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.card h3 { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.card p { margin: 0; }

.proof { list-style: none; padding: 0; margin: 0.15rem 0 0; font-size: 0.9375rem; }
.proof li { position: relative; padding-left: 1.1rem; margin-bottom: 0.3rem; }
.proof li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.5rem;
  height: 1px;
  background: var(--accent);
}

.tags { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.card-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: auto; padding-top: 0.4rem; font-size: 0.9375rem; }

.chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
.chip.live {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

@media (min-width: 48rem) {
  .work-grid { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: 1 / -1; flex-direction: row; }
  .card.featured .cover {
    flex: 0 0 58%;
    aspect-ratio: auto;
    min-height: 19rem;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .card.featured .card-body { justify-content: center; padding: 1.75rem; }
}

/* Covers drawn in HTML/SVG */
.cover-thinkery,
.cover-graph,
.cover-stats,
.cover-greek { display: flex; align-items: center; justify-content: center; }

.tk-page {
  width: 84%;
  max-width: 22rem;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fg);
}
.tk-page p { margin: 0; }
.tk-page mark { background: var(--hl); color: inherit; padding: 0 0.1em; border-radius: 2px; }
.tk-keys { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.8rem; font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }
.tk-keys span { padding: 0.1rem 0.4rem; border: 1px solid var(--rule-strong); border-radius: 5px; }
.tk-keys .on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.cover-graph svg { width: 100%; height: 100%; }
.g-edges line { stroke: var(--rule-strong); stroke-width: 1; }
.g-path line { stroke: var(--accent); stroke-width: 1.6; }
.g-nodes circle { fill: var(--accent); }
.g-nodes .n0 { fill-opacity: 1; }
.g-nodes .n1 { fill-opacity: 0.5; }
.g-nodes .n2 { fill-opacity: 0.28; }
.g-nodes .n3 { fill-opacity: 0.16; }
.g-nodes .hot { fill-opacity: 0.85; }

.cover-stats { flex-wrap: wrap; align-content: center; gap: 0.25rem 2.5rem; padding: 1.5rem; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 2.6rem); line-height: 1; color: var(--fg); }
.stat-label { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-delta { margin-top: 0.15rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--accent); }
.stat-note { flex-basis: 100%; margin: 0.9rem 0 0; text-align: center; font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }

.cover-greek span { font-family: var(--greek); font-style: italic; font-size: clamp(2rem, 5vw, 2.75rem); color: var(--faint); }

/* Writing list */
.essays { list-style: none; padding: 0; margin: 0; }
.essays li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.essays a { font-family: var(--serif); font-size: 1.2rem; color: var(--fg); text-decoration: none; }
.essays a:hover, .essays a:focus-visible { color: var(--accent); }

/* Background */
.bg-grid { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0 2rem; }
.bg-grid > h3 { margin: 0.3rem 0 0; font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.bg-grid > div,
.bg-grid > ul,
.bg-grid > dl { margin: 0 0 2.25rem; }

@media (max-width: 40rem) {
  .bg-grid { grid-template-columns: 1fr; }
  .bg-grid > h3 { margin-bottom: 0.75rem; }
}

.entries { list-style: none; padding: 0; margin: 0; }
.entries > li { margin: 0 0 1.25rem; }
.entries p { margin: 0.2rem 0 0; }

.entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; }
.entry-title { font-weight: 600; }
.date { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.skills { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem 1rem; }
.skills dt { padding-top: 0.15rem; font-size: 0.875rem; color: var(--muted); }
.skills dd { margin: 0; }

@media (max-width: 34rem) {
  .skills { grid-template-columns: 1fr; gap: 0; }
  .skills dd { margin-bottom: 0.75rem; }
}

/* Inner pages */
.shot { margin: 0 0 2.25rem; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--soft); }
.shot img { display: block; width: 100%; height: auto; }

/* Essays */
.essay { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.7; }
.essay h1 { margin-bottom: 0.4rem; }
.essay h2 { font-family: var(--serif); font-size: 1.35rem; margin-top: 2.25rem; }
.essay .essay-date { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); margin-bottom: 2.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; padding-top: 0.5rem; text-align: left; font-size: 0.8125rem; color: var(--muted); }
th, td { padding: 0.45rem 1rem 0.45rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { font-weight: 600; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.05em 0.35em;
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

/* Blockquotes */
blockquote { margin: 0 0 1.5rem; padding-left: 1.25rem; border-left: 3px solid var(--rule-strong); color: var(--muted); }

/* Greek text helper */
.greek { font-family: var(--greek); font-size: 1.1rem; line-height: 1.8; margin: 1.25rem 0; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 5rem;
  padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--muted);
}
