/* emrebugday.com. Pure HTML/CSS, no JS.
   Voice of the design: clinical, generous, collegial. Hairlines, not shadows.
   The work makes the claim; the layout stays out of its way. */

:root {
  --bg: #fafaf7;
  --ink: #1c1c1a;
  --muted: #6b6b64;
  --hairline: #e3e3da;
  --accent: #b34700;
  --accent-ink: #8a3700;
  --card: #ffffff;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --ink: #e8e8e2;
    --muted: #9a9a90;
    --hairline: #2e2e29;
    --accent: #e8731f;
    --accent-ink: #f0863a;
    --card: #1d1d1a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* ---------- layout ---------- */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.prose { max-width: 680px; }

main { padding-bottom: 4rem; }

section { margin: 4rem 0; }

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

.site-header {
  border-bottom: 1px solid var(--hairline);
  padding: 1.5rem 0 1.25rem;
}

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

.site-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- type ---------- */

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

p { margin: 0 0 1rem; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* keyboard focus: visible ring for tab navigation */
a:focus-visible,
.site-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero { padding: 4.5rem 0 1rem; }

/* ---------- work entries ---------- */

.entry {
  border-top: 1px solid var(--hairline);
  padding: 2.25rem 0;
  display: grid;
  gap: 0.5rem;
}

.entry:last-child { border-bottom: 1px solid var(--hairline); }

.entry p { max-width: 680px; }

.entry .links {
  font-size: 0.9rem;
  font-family: var(--mono);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.receipt {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- embeds: static iframes, responsive, capped ---------- */

.media {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 760px;
  margin: 0.75rem 0;
}

.media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #000;
}

/* ---------- lists ---------- */

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

ul.plain li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hairline);
}

ul.plain li:first-child { border-top: 1px solid var(--hairline); }

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

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 0 3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  justify-content: space-between;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- articles ---------- */

.article h1 { margin-top: 0.25rem; }

.article h2 { margin-top: 2.5rem; }

.article .lede { margin-bottom: 2rem; }

.article-foot {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* linked titles in entry lists: read as headings, accent on hover */
.entry h2 a {
  color: var(--ink);
  text-decoration: none;
}

.entry h2 a:hover { color: var(--accent); }

/* ---------- code ---------- */

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.08em 0.34em;
}

pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

pre code {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 2.5rem; }
  section { margin: 3rem 0; }
}
