/* fedoni.uk — shared design system.
   Warm paper / ink editorial: Fraunces display, Geist body, JetBrains Mono labels.
   Theme via body.dark; toggled in main.js, persisted in localStorage. */

/* ---------- Tokens ---------- */

body {
  --bg: #f7f4ee;
  --fg: #211d15;
  --muted: #6f6758;
  --rule: #e5dfd2;
  --accent: #96511d;
  --chip: #ede7da;
  --card: #fffdf8;
  --pull-bg: #efeadf;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Geist", "Inter Tight", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;

  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-family: var(--sans);
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dark {
  --bg: #171310;
  --fg: #ece5d8;
  --muted: #9a9080;
  --rule: #2b251d;
  --accent: #d9a06b;
  --chip: #221d16;
  --card: #1d1813;
  --pull-bg: #1e1913;
}

/* ---------- Base ---------- */

html, body { margin: 0; padding: 0; }
* { box-sizing: border-box; }
button:focus-visible, a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
pre { white-space: pre-wrap; }

/* Soft accent wash bleeding down from the top edge */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
}

#site-wrap {
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
@media (min-width: 901px) {
  #site-wrap { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
}

a { color: var(--accent); }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 56px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.topbar-brand { color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.topbar-brand .site-name { color: var(--fg); }
.topbar-brand:hover { color: var(--fg); }
.topbar-right { display: flex; gap: 24px; align-items: center; }

.online-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: #4ca77a; margin-right: 6px; vertical-align: middle;
  animation: online-pulse 2.6s ease-out infinite;
}
@keyframes online-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 167, 122, 0.4); }
  60%  { box-shadow: 0 0 0 5px rgba(76, 167, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 167, 122, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .online-dot { animation: none; }
}

#theme-btn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--fg);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
#theme-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Layout ---------- */

.main { padding: 72px 64px 88px; }

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}
.section-label .para { opacity: 0.7; margin-right: 8px; }
.section-label .count { margin-left: 8px; }
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin-left: 16px;
}

.footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.footer a:hover { color: var(--accent); }

.back-link {
  display: inline-block;
  margin-bottom: 44px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--accent); }

/* ---------- Hero (homepage) ---------- */

.hero { margin-bottom: 72px; }
.hero-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 28px;
}
.hero-kicker .name { color: var(--fg); }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6.5vw, 56px);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 0 0 26px;
  color: var(--fg);
}
.hero-title .muted { color: var(--muted); }
.hero-title .accent { color: var(--accent); }
.hero-p {
  font-size: 17px;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 0 28px;
  color: var(--fg);
  opacity: 0.88;
}
.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin: 0 0 28px;
}
.hire-pointer {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  padding: 8px 14px;
  border-radius: 3px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.hire-pointer:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ---------- Now + Stack ---------- */

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 76px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--rule);
}
.now-list { font-size: 14.5px; line-height: 1.7; }
.now-row { margin-bottom: 14px; }
.now-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-right: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 9px;
  background: var(--chip);
  font-size: 11.5px;
  color: var(--fg);
  font-family: var(--mono);
  border-radius: 3px;
}

/* ---------- Hairline row lists ---------- */

.row {
  display: grid;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  color: var(--fg);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.row:last-of-type { border-bottom: 1px solid var(--rule); }
.row:hover { background-color: color-mix(in srgb, var(--fg) 4%, transparent); }
.row .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.row .name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.2px;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.row:hover .name { color: var(--accent); }
.row .blurb { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.row .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.row .arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  transition: transform 0.2s ease;
}
.row:hover .arrow { transform: translate(2px, -2px); }

.row--project { grid-template-columns: 40px 168px 1fr 118px 18px; }
.row--writing { grid-template-columns: 40px 1fr 90px; }
.row--writing .name { font-size: 17px; }
.row--contact { grid-template-columns: 40px 140px 1fr 150px 18px; }
.row--contact .name { font-family: var(--sans); font-size: 16px; font-weight: 500; }
.row--contact .handle { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.badge-soon, .badge-archived {
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 400;
}
.badge-soon {
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.badge-archived {
  color: var(--muted);
  border: 1px solid var(--rule);
}

.projects-section, .writing-section { margin-bottom: 76px; }
.contact-desc {
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 20px;
  color: var(--fg);
  opacity: 0.85;
  max-width: 540px;
}

/* ---------- Page headers (writing index, hire) ---------- */

.page-title {
  font-family: var(--serif);
  font-size: clamp(34px, 5.5vw, 46px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin: 0 0 14px;
  color: var(--fg);
}
.page-subtitle {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 56px;
  max-width: 540px;
}

/* ---------- Hire page ---------- */

.hire-main { max-width: 720px; }
.hire-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5.5vw, 44px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin: 0 0 24px;
  color: var(--fg);
  max-width: 16em;
}
.hire-title em { font-style: italic; font-weight: 500; }
.hire-intro {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--fg);
  opacity: 0.88;
  max-width: 600px;
  margin: 0 0 64px;
}
.hire-section { margin-bottom: 60px; }

.offer {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.offer:last-of-type { border-bottom: 1px solid var(--rule); }
.offer-name {
  font-family: var(--serif);
  font-size: 17.5px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.offer-desc { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0; }

.proof-lead {
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 20px;
  max-width: 600px;
}
.proof-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
  line-height: 1.6;
}
.proof-item:last-of-type { border-bottom: 1px solid var(--rule); }
.proof-item .p-name { font-family: var(--serif); font-size: 16px; font-weight: 500; }
.proof-item .p-name a { color: var(--fg); text-decoration: none; transition: color 0.15s ease; }
.proof-item .p-name a:hover { color: var(--accent); }
.proof-item .p-desc { color: var(--muted); margin: 0; }

.case {
  border-left: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  padding: 4px 0 4px 18px;
  margin: 22px 0;
  font-size: 14.5px;
  line-height: 1.65;
}
.case p { margin: 0; }
.case .case-quote { color: var(--muted); font-style: italic; }
.stats-line {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin: 24px 0 0;
}

.creds {
  display: flex;
  gap: 40px;
  align-items: center;
}
.creds-lines { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.6; }
.creds-lines li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.creds-lines li:last-child { border-bottom: none; }
.creds-lines .cred-org { font-family: var(--serif); font-weight: 500; font-size: 15.5px; margin-right: 6px; }
.creds-lines .cred-detail { color: var(--muted); }
.creds-lines a { color: var(--accent); text-decoration: none; }
.creds-lines a:hover { text-decoration: underline; text-underline-offset: 3px; }
body.dark #r .a { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }

.how-p {
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 600px;
  margin: 0;
}

.contact-lead { font-size: 15.5px; margin: 0 0 14px; }
.contact-big {
  font-family: var(--serif);
  font-size: clamp(24px, 4.5vw, 32px);
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.15s ease;
}
.contact-big:hover { border-color: var(--accent); }
.contact-secondary { font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.contact-secondary a { color: var(--accent); text-decoration: none; }
.contact-secondary a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Writing article ---------- */

.article {
  padding: 72px 56px 96px;
  max-width: 720px;
  margin: 0 auto;
}
.post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}
.post-meta .sep { opacity: 0.5; }
.post-tags { display: flex; gap: 8px; }

.post-title {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 50px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 0 0 48px;
  color: var(--fg);
}

.post-body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  color: var(--fg);
}
.post-body p { margin: 0 0 22px; }
.post-body .lede {
  font-size: 21px;
  line-height: 1.55;
  margin: 0 0 40px;
  opacity: 0.92;
  border-left: 2px solid var(--accent);
  padding-left: 20px;
}
.post-body h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 48px 0 16px;
  color: var(--fg);
}
.post-body blockquote {
  margin: 40px -20px;
  padding: 28px 32px;
  background: var(--pull-bg);
  font-size: 22px;
  line-height: 1.45;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: var(--fg);
  border-left: 3px solid var(--accent);
}
.post-footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.post-footer a { color: var(--muted); text-decoration: none; }
.post-footer a:hover { color: var(--accent); }

.navgrid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.nav-box { padding: 20px 24px; border: 1px solid var(--rule); opacity: 0.5; }
.nav-box-right { text-align: right; }
.nav-box-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.nav-box-text { font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */

@media (min-width: 721px) and (max-width: 900px) {
  .topbar { padding: 20px 32px; }
  .main { padding: 56px 32px 64px; }
  .article { padding: 56px 32px 64px; }
}

@media (max-width: 720px) {
  .topbar { padding: 16px 20px; gap: 12px; flex-wrap: wrap; }
  .main { padding: 40px 20px 56px; }
  .article { padding: 40px 20px 64px; }

  .hero { margin-bottom: 48px; }
  .twocol { grid-template-columns: 1fr; gap: 36px; margin-bottom: 48px; padding-bottom: 32px; }

  .row--project {
    grid-template-columns: 32px 1fr 18px;
    gap: 4px 12px;
    grid-template-areas:
      "num name arrow"
      "num blurb arrow"
      "num meta arrow";
    align-items: start;
    padding: 16px 0;
  }
  .row--project .num { grid-area: num; padding-top: 4px; }
  .row--project .name { grid-area: name; font-size: 18px; }
  .row--project .blurb { grid-area: blurb; }
  .row--project .meta { grid-area: meta; text-align: left; font-size: 10px; opacity: 0.8; }
  .row--project .arrow { grid-area: arrow; align-self: center; }

  .row--writing { grid-template-columns: 32px 1fr; gap: 4px 12px; padding: 14px 0; }
  .row--writing .date { grid-column: 2; text-align: left; font-size: 10px; }

  .row--contact {
    grid-template-columns: 32px 1fr;
    gap: 4px 12px;
    grid-template-areas:
      "num name"
      "num handle";
    padding: 14px 0;
  }
  .row--contact .num { grid-area: num; }
  .row--contact .name { grid-area: name; }
  .row--contact .handle { grid-area: handle; }
  .row--contact .note, .row--contact .arrow { display: none; }

  .offer { grid-template-columns: 1fr; gap: 4px; }
  .proof-item { grid-template-columns: 1fr; gap: 2px; }
  .creds { flex-direction: column; align-items: flex-start; gap: 28px; }
  .hire-intro { margin-bottom: 48px; }
  .hire-section { margin-bottom: 48px; }

  .post-body { font-size: 17px; }
  .post-body blockquote { margin: 28px 0; padding: 20px; font-size: 19px; }
  .navgrid { grid-template-columns: 1fr; }
  .footer { padding-top: 20px; flex-wrap: wrap; gap: 8px; }
}
