/* ============================================================
   kaansali.com — shared stylesheet
   Editorial & warm; orange + teal accents on neutral cream
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Neutrals — warm cream palette */
  --bg:        #f7f4ec;
  --bg-elev:   #fbf9f2;
  --surface:   #ffffff;
  --ink:       #1a1814;
  --ink-soft:  #4d4a44;
  --ink-mute:  #8a857c;
  --line:      #e6e1d4;
  --line-soft: #efeae0;

  /* Accents — controlled by theme */
  --orange:    #d85a1f;
  --orange-soft: #fbeee5;
  --teal:      #1f8b86;
  --teal-soft: #e3f1f0;

  /* Primary accent (swappable via tweaks) */
  --accent:      var(--orange);
  --accent-soft: var(--orange-soft);
  --accent-2:    var(--teal);

  /* Type */
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Geometry */
  --pad-x: 56px;
  --max-w: 1240px;
  --radius: 4px;
}

[data-theme="dark"] {
  --bg:        #131210;
  --bg-elev:   #1a1816;
  --surface:   #1f1d1a;
  --ink:       #f3eee2;
  --ink-soft:  #b3ad9e;
  --ink-mute:  #7a766c;
  --line:      #2c2925;
  --line-soft: #232120;
  --orange-soft: #2a1d14;
  --teal-soft:   #14272a;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.018em;
}
.mono {
  font-family: var(--mono);
  font-feature-settings: 'ss02';
}

/* ──────────────────────────────────────────
   HEADER / NAV
   ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: end;
  gap: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 0.83;
}
.brand-mark {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-right: -4px;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-name em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 34px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.main-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right 0.25s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { right: 0; }
.main-nav a.active { color: var(--ink); }
.main-nav a.active::after { right: 0; background: var(--accent); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.header-tools button {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  transition: all 0.2s;
}
.header-tools button:hover {
  border-color: var(--ink);
  color: var(--ink);
}
/* ── Language switch (single anchor chip) ─────── */
.lang-switch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--accent) 32%, var(--line));
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lang-switch:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.lang-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding-bottom: 28px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.section-head .lede {
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 16px;
  justify-self: end;
  text-align: right;
  text-wrap: pretty;
}

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: none; }

/* ──────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: color-mix(in oklab, var(--bg) 70%, transparent);
  padding: 80px var(--pad-x) 40px;
  margin-top: 0;
}
[data-theme="dark"] .site-footer {
  background: #0a0908;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid color-mix(in oklab, var(--bg) 20%, transparent);
}
.footer-inner h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--bg) 50%, transparent);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-inner ul { list-style: none; display: grid; gap: 10px; font-size: 14px; }
.footer-inner ul a { color: color-mix(in oklab, var(--bg) 80%, transparent); transition: color 0.2s; }
.footer-inner ul a:hover { color: var(--bg); }
.footer-brand .serif {
  display: block;
  color: var(--bg);
  font-size: 28px;
  margin-bottom: 14px;
}
.footer-brand p { font-size: 14px; max-width: 320px; line-height: 1.6; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--bg) 45%, transparent);
}

/* ──────────────────────────────────────────
   BUTTONS / LINKS
   ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--surface);
}
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  transition: all 0.2s;
}
.text-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ──────────────────────────────────────────
   PLACEHOLDER (image, photo)
   ────────────────────────────────────────── */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      45deg,
      var(--line-soft) 0 8px,
      var(--surface) 8px 16px
    );
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  padding: 24px;
}

/* ──────────────────────────────────────────
   SCROLL REVEAL (utility)
   ────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ──────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --pad-x: 24px; }
  .site-header-inner { flex-wrap: wrap; row-gap: 10px; }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 24px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    font-size: 12px;
  }
  .main-nav a { font-size: 12px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .lede { text-align: left; justify-self: start; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; }
}
