/* =========================================================
   guvenaydin.com - editorial / light
   Serif: Newsreader · Meta/mono: IBM Plex Mono
   Paper white · near-black ink · one restrained pine accent
   ========================================================= */

:root {
  --paper:   #faf9f6;   /* warm-neutral paper, not beige */
  --paper-2: #f2f1ec;   /* faint fill for hover/rules */
  --ink:     #17181b;   /* near-black */
  --muted:   #63656b;
  --faint:   #9a9ca1;
  --line:    #e3e2db;
  --line-2:  #d3d2ca;

  --accent:      #14584a;   /* pine */
  --accent-soft: #1c7a66;
  --accent-wash: rgba(20, 88, 74, 0.07);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 40rem;      /* text column */
  --page:    46rem;      /* outer column */
  --pad:     clamp(1.35rem, 5vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.06rem, 1.01rem + 0.25vw, 1.19rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--paper); }

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

/* ---------- layout ---------- */
.page {
  max-width: var(--page);
  margin-inline: auto;
  padding: 0 var(--pad) 5rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.kicker::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--line-2);
}

/* ---------- header ---------- */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.6rem, 4vw, 2.6rem) 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.masthead__name { letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.masthead__name b { font-weight: 500; }
.masthead nav { display: flex; gap: 1.4rem; }
.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.masthead nav a:hover, .masthead nav a:focus-visible { color: var(--accent); border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: clamp(3.2rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero__lede {
  font-size: clamp(1.7rem, 1.1rem + 3vw, 3rem);
  line-height: 1.16;
  font-weight: 400;
  letter-spacing: -0.014em;
  margin: 1.5rem 0 0;
  max-width: 20ch;
  text-wrap: balance;
}
.hero__lede em { font-style: italic; color: var(--accent); }
.hero__body { max-width: var(--measure); margin: 1.8rem 0 0; color: #2c2d31; }
.hero__body p { margin: 0 0 1rem; }
.hero__aside {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  border-left: 2px solid var(--line-2);
  padding-left: 1rem;
  margin-top: 1.8rem;
  max-width: 44ch;
}

/* redaction - subtle curiosity accent for light bg */
.redact {
  background: var(--ink);
  color: var(--ink);
  border-radius: 1px;
  padding: 0 0.12em;
  cursor: help;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-user-select: none; user-select: none;
}
.redact:hover, .redact:focus-visible { background: var(--accent-wash); color: var(--accent); -webkit-user-select: text; user-select: text; }

/* ---------- section scaffold ---------- */
.section { padding: clamp(2.6rem, 6vw, 4.2rem) 0 0; }
.section > .kicker { margin-bottom: 1.6rem; }

/* ---------- what I do - definition list ---------- */
.defs { margin: 0; display: grid; gap: 0; }
.def {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.3rem 1.6rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.def:last-child { border-bottom: 1px solid var(--line); }
.def dt {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding-top: 0.2rem;
}
.def dd { margin: 0; color: #34353a; }
.def dd a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.def dd a:hover, .def dd a:focus-visible { color: var(--accent-soft); }
.def.is-security dt { color: var(--accent); }
.def.is-security dd { color: var(--ink); }
@media (max-width: 560px) {
  .def { grid-template-columns: 1fr; gap: 0.1rem; }
  .def dd { color: var(--muted); }
}

/* ---------- writing ---------- */
.writing-list { list-style: none; margin: 0; padding: 0; }
.writing-list li { border-top: 1px solid var(--line); }
.writing-list li:last-child { border-bottom: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  gap: 0.4rem 1.4rem;
  align-items: baseline;
  padding: 1.1rem 0;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.25s ease, background 0.25s ease;
}
.entry:hover, .entry:focus-visible { padding-left: 0.7rem; background: linear-gradient(90deg, var(--accent-wash), transparent 70%); }
.entry__date { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); letter-spacing: 0.03em; padding-top: 0.35rem; }
.entry__title { font-size: 1.24rem; line-height: 1.28; letter-spacing: -0.01em; }
.entry:hover .entry__title { color: var(--accent); }
.entry__go { font-family: var(--mono); color: var(--faint); transition: transform 0.25s ease, color 0.25s ease; }
.entry:hover .entry__go { color: var(--accent); transform: translateX(3px); }
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: 0.15rem; }
  .entry__go { display: none; }
}

/* ---------- about / note ---------- */
.note { max-width: var(--measure); color: #2c2d31; }
.note p { margin: 0 0 1rem; }
.note .lead-in { font-style: italic; color: var(--accent); }

/* ---------- contact ---------- */
.contact { max-width: var(--measure); }
.contact__q { font-size: clamp(1.3rem, 1rem + 1.5vw, 1.8rem); line-height: 1.25; margin: 0 0 1.3rem; letter-spacing: -0.01em; }
.mail {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: color 0.2s ease, background 0.2s ease;
}
.mail:hover, .mail:focus-visible { color: var(--accent-soft); }

/* ---------- footer ---------- */
.foot {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.foot__social { display: flex; gap: 1.2rem; }
.foot__social a { color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.foot__social a:hover, .foot__social a:focus-visible { color: var(--accent); }

/* ---------- contact page ---------- */
.contact-intro { max-width: var(--measure); }
.contact-intro .contact__q { margin-top: 0.4rem; }

.mapfig { margin: clamp(1.8rem, 5vw, 3rem) 0 0; }
.mapfig img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}
.blink-colon {
  animation: softblink 1.3s ease-in-out infinite;
}
@keyframes softblink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.18; }
}
@media (prefers-reduced-motion: reduce) {
  .blink-colon { animation: none; }
}

.mapfig figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form { max-width: 34rem; margin: clamp(2.2rem, 6vw, 3.5rem) 0 0; }
.field { margin: 0 0 1.5rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 0.55rem 0.1rem;
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 6.5rem; line-height: 1.5; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }

.field--challenge {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1rem 1.1rem 1.1rem;
}
.field--challenge .q { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin: 0 0 0.2rem; }
.field--challenge .hint { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--faint); text-transform: uppercase; }
.field--challenge .hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.field--challenge .hint a:hover, .field--challenge .hint a:focus-visible { color: var(--accent-soft); }
.field--challenge input { max-width: 12rem; margin-top: 0.6rem; }

/* honeypot - hidden from humans, tempting to bots */
.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.submit:hover, .submit:focus-visible { background: var(--accent-soft); }

.form-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.9rem 1.1rem;
  border-radius: 3px;
  margin: 0 0 1.8rem;
  border: 1px solid var(--line-2);
}
.form-status[data-kind="ok"]  { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.form-status[data-kind="err"] { border-color: #b4442f; color: #9e3b29; background: rgba(180,68,47,0.06); }
.form-status[hidden] { display: none; }

.epigraph {
  font-style: italic;
  color: var(--muted);
  max-width: var(--measure);
  margin: clamp(2.4rem, 6vw, 3.5rem) 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.epigraph cite { display: block; font-style: normal; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-top: 0.6rem; }

/* ---------- article (blog) ---------- */
.article { max-width: var(--measure); padding-top: clamp(2rem, 5vw, 3rem); }
.article__cover { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; margin: 0.6rem 0 0.4rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.article__title { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; margin: 1rem 0 0.8rem; font-weight: 400; text-wrap: balance; }
.article__meta { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.prose p { margin: 0 0 1.25rem; }
.prose h2 { font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.7rem); font-weight: 500; letter-spacing: -0.01em; margin: 2.4rem 0 0.8rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-soft); }
.prose code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 3px; padding: 0.08em 0.36em; }
.prose blockquote {
  margin: 1.6rem 0;
  padding-left: 1.3rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  font-size: 1.22rem;
  color: var(--ink);
}
.backlink { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted); text-decoration: none; }
.backlink:hover { color: var(--accent); }

/* ---------- load fade (progressive, never hides content without JS) ---------- */
.fade { transition: opacity 0.7s ease, transform 0.7s ease; }
.js .fade { opacity: 0; transform: translateY(10px); }
.js body.ready .fade { opacity: 1; transform: none; }
.fade.d1 { transition-delay: 0.06s; }
.fade.d2 { transition-delay: 0.12s; }
.fade.d3 { transition-delay: 0.18s; }
@media (prefers-reduced-motion: reduce) {
  .js .fade { opacity: 1; transform: none; transition: none; }
}
