/* ═══════════════════════════════════════════════
   ŞAFAK KARAKULAK — safakkarakulak.com
   Palette and lettering derived from the covers:
   warm near-black grounds, gilt, wide-tracked caps.
   ═══════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;1,6..72,300;1,6..72,400&family=IBM+Plex+Mono:wght@400&display=swap");

:root {
  /* Grounds — warm, from The Earlier */
  --ink:     #0E0C0A;
  --ground:  #17140F;
  --deep:    #262E34;   /* the Unforgotten blue, for the writing side */

  /* Light */
  --bone:    #E9E3D7;
  --dust:    #9C9285;

  /* Gilt — the calendar glow, the carved bird */
  --gilt:    #B9975B;
  --gilt-lo: #6F5C39;

  --seam:    #3A332A;

  --display: "Cormorant Garamond", Georgia, serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --step:    clamp(4.5rem, 9vw, 9rem);
  --gutter:  clamp(1.5rem, 5vw, 4.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── The seam ─────────────────────────────────── */

body::before {
  content: "";
  position: fixed;
  top: 0; left: 50%;
  width: 1px; height: 100%;
  background: linear-gradient(180deg,
    transparent, var(--seam) 12%, var(--seam) 88%, transparent);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

/* ── Grain + vignette — the depth the covers have ── */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%,
    transparent 30%, rgba(0,0,0,0.42) 100%);
}

main, header, footer { position: relative; z-index: 3; }

/* ── Light register — writing ─────────────────── */

body.is-light {
  background: var(--bone);
  color: #1A1713;
}
body.is-light .vignette {
  background: radial-gradient(ellipse at 50% 40%,
    transparent 40%, rgba(120,105,80,0.13) 100%);
}
body.is-light { --dust: #6E6558; --seam: #C7BEAC; }
body.is-light .site-head { background: color-mix(in srgb, var(--bone) 82%, transparent); }
body.is-light .lede { color: #58503F; }

/* ── Registers of type ────────────────────────── */

.meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dust);
  margin: 0;
}

/* Wide-tracked caps — lifted straight from the covers */
.caps {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  line-height: 1.3;
}

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

/* ── Header ───────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem var(--gutter);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--seam);
}

.site-mark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav { display: flex; gap: clamp(0.9rem, 2.6vw, 2.2rem); }
.site-nav a {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--dust);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.45s ease, border-color 0.45s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--gilt); border-bottom-color: var(--gilt-lo); }

/* ── Hero ─────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--step) var(--gutter);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--ground) center/cover no-repeat;
  opacity: 0.2;
  z-index: -1;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 2.2rem 0 0;
}

.hero__sub {
  color: var(--dust);
  max-width: 36ch;
  margin: 1.8rem auto 0;
  font-size: 1.02rem;
}

/* ── Page head ────────────────────────────────── */

.page-head {
  padding: calc(var(--step) * 0.85) var(--gutter) 0;
  max-width: 1080px;
  margin: 0 auto;
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.1rem, 5.2vw, 3.8rem);
  line-height: 1.07;
  margin: 1.3rem 0 0;
}
.page-head h1.caps {
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  font-weight: 400;
}
.lede {
  max-width: 44ch;
  margin: 1.6rem 0 0;
  color: var(--dust);
  font-size: 1.02rem;
}

.epigraph {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.55;
  color: var(--gilt);
  max-width: 30ch;
  margin: 2rem 0 0;
}

/* ── Split ────────────────────────────────────── */

.split { display: grid; grid-template-columns: 1fr 1fr; }

.split__side {
  padding: var(--step) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
  position: relative;
  overflow: hidden;
}
.split__side--dark { background: var(--ink); text-align: right; align-items: flex-end; }
.split__side--light { background: var(--deep); }
.split__side .bg {
  position: absolute; inset: 0;
  background: center/cover no-repeat;
  opacity: 0.16;
}
.split__side > *:not(.bg) { position: relative; }

.split h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.1;
  margin: 1.3rem 0 1rem;
}
.split__body { max-width: 34ch; margin: 0; color: var(--dust); }

/* ── Links ────────────────────────────────────── */

.link {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  margin-top: 2.4rem;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--gilt-lo);
  color: var(--gilt);
  transition: color 0.45s ease, border-color 0.45s ease;
}
.link:hover { color: var(--bone); border-color: var(--bone); }
body.is-light .link:hover { color: #1A1713; border-color: #1A1713; }

/* ── Index of works ───────────────────────────── */

.index { padding: var(--step) var(--gutter); max-width: 1080px; margin: 0 auto; }

.index-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--seam);
  padding-bottom: 1rem;
}

.row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 1.6rem;
  align-items: baseline;
  padding: 2rem 0;
  border-bottom: 1px solid var(--seam);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.5s ease;
}
.index:hover .row:not(:hover) { opacity: 0.38; }

.row__num { font-family: var(--mono); font-size: 10.5px; color: var(--dust); letter-spacing: 0.1em; }
.row__title {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(1.05rem, 2.3vw, 1.5rem);
  line-height: 1.3;
  display: block;
  transition: color 0.45s ease;
}
.row:hover .row__title { color: var(--gilt); }
.row__note {
  font-size: 0.9rem;
  color: var(--dust);
  display: block;
  margin-top: 0.55rem;
  max-width: 46ch;
  line-height: 1.6;
}
.row__year { font-family: var(--mono); font-size: 10.5px; color: var(--dust); letter-spacing: 0.12em; white-space: nowrap; }

.row.is-quiet { pointer-events: none; }
.row.is-quiet .row__title { color: var(--dust); }

/* ── Work entry ───────────────────────────────── */

.entry {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  padding: var(--step) var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
}

.entry__media {
  aspect-ratio: 2 / 3;
  background: var(--ground) center/cover no-repeat;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.entry__title {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.25;
  margin: 1rem 0 1.2rem;
}
.entry__body { max-width: 42ch; color: var(--dust); margin: 0; }

/* ── Prose ────────────────────────────────────── */

.prose {
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--step) var(--gutter);
  font-size: 1.06rem;
  line-height: 1.85;
}
.prose p { margin: 0 0 1.45rem; }
.prose p:last-child { margin-bottom: 0; }
.prose .first { margin-top: 0; }
.prose .first::first-letter {
  font-family: var(--display);
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.1em 0 0;
  color: var(--gilt);
  font-weight: 400;
}
.prose h2 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1rem;
  margin: 3.5rem 0 1.4rem;
  color: var(--dust);
}
.prose em { font-style: italic; }

.divider {
  text-align: center;
  margin: 3rem 0;
  color: var(--gilt);
  font-size: 0.9rem;
  letter-spacing: 0.9em;
}

.colophon-note {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--step);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--dust);
  border-top: 1px solid var(--seam);
  padding-top: 2.5rem;
}

/* ── Interlude ────────────────────────────────── */

.interlude { padding: calc(var(--step) * 1.2) var(--gutter); text-align: center; }
.interlude p {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.5;
  max-width: 28ch;
  margin: 0 auto;
  color: var(--gilt);
}

/* ── Gallery ──────────────────────────────────── */

.gallery { display: grid; padding: 0 var(--gutter) var(--step); max-width: 1180px; margin: 0 auto; }
.gallery--single { grid-template-columns: 1fr; gap: var(--step); }
.gallery--grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 4px; }

.plate { margin: 0; }
.plate img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: var(--ground);
  transition: opacity 0.45s ease;
}
.plate img:hover { opacity: 0.85; }
.plate figcaption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dust);
  margin-top: 1rem;
}

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,7,6,0.97);
  display: none; align-items: center; justify-content: center;
  padding: 3vmin;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; display: block; }
.lightbox__close {
  position: absolute; top: 1.4rem; right: 1.6rem;
  background: none; border: 0; color: var(--gilt);
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.17em; text-transform: uppercase;
  cursor: pointer; padding: 0.5rem;
}

/* ── Form ─────────────────────────────────────── */

.form { max-width: 32rem; margin: 0 auto; padding: 0 var(--gutter) var(--step); }
.field { margin-bottom: 1.9rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 0.6rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--seam);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.6rem 0;
  border-radius: 0;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-bottom-color: var(--gilt);
}
.field select option { background: var(--ink); color: var(--bone); }

.submit {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--gilt-lo);
  color: var(--gilt);
  padding: 0.95rem 2.2rem;
  cursor: pointer;
  transition: border-color 0.45s ease, color 0.45s ease;
}
.submit:hover { border-color: var(--gilt); color: var(--bone); }

/* ── Footer ───────────────────────────────────── */

.colophon {
  border-top: 1px solid var(--seam);
  padding: 3.5rem var(--gutter) 4.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  max-width: 1080px;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
}
.colophon a { color: var(--dust); text-decoration: none; transition: color 0.45s ease; }
.colophon a:hover { color: var(--gilt); }

/* ── Reveal ───────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Quality floor ────────────────────────────── */

a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 4px;
}

.skip { position: absolute; left: -9999px; font-family: var(--mono); font-size: 10.5px; }
.skip:focus {
  left: var(--gutter); top: 0.6rem; z-index: 200;
  background: var(--ink); color: var(--gilt);
  padding: 0.7rem 1rem; border: 1px solid var(--gilt-lo);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── Mobile ───────────────────────────────────── */

@media (max-width: 860px) {
  body::before { left: 1.5rem; opacity: 0.5; }
  .site-head { flex-direction: column; gap: 0.85rem; align-items: flex-start; }
  .site-nav { flex-wrap: wrap; gap: 0.85rem 1.3rem; }
  .split { grid-template-columns: 1fr; }
  .split__side { min-height: 0; }
  .split__side--dark { text-align: left; align-items: flex-start; }
  .entry { grid-template-columns: 1fr; }
  .entry__media { max-width: 20rem; }
  .row { grid-template-columns: 2.5rem 1fr; }
  .row__year { grid-column: 2; }
  .prose { font-size: 1.02rem; }
}
