/*
 * Cosmine — shared styles (header, footer, legal pages).
 * Colours, type and radii from source/brand/tokens.css (app theme).
 * Light theme only (the app's light palette); app screenshots stay dark.
 * Flat: no shadows, no gradients. Depth only through surface tones.
 */
/* Fonts: self-hosted, SIL OFL 1.1 (see /assets/fonts/OFL-*.txt). latin + latin-ext cover Turkish. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Site theme: LIGHT only (brand.md §2 "Site teması"). No automatic dark mode. */
  color-scheme: light;
  --bg: #ebdfd7;
  --surface: #e0d2c9;
  --surface-elevated: #d6c6bc;
  --surface-deep: #726966;
  --surface-inverse: #3e3230;
  --border: #d3c3b9;
  --text: #3e3230;
  --text-secondary: #6f615c;   /* only on --bg, never inside cards */
  --text-muted: #a2928b;       /* decoration / large text only */
  --text-inverse: #f1e7df;
  --accent: #d98e8c;           /* decoration only; never a text colour */
  --accent-strong: #c9716e;
  --accent-muted: #e6b9b6;
  --moon-lit: #fbf6f2;
  --moon-line: #9c8c85;

  /* Accessible roles (WCAG AA checked, see brand.md §2) */
  --fg-2: var(--text-secondary);   /* secondary text on --bg */
  --fg-2-card: var(--text);        /* all text inside cards */
  --link: var(--text);
  --link-line: var(--accent-strong);
  --overline: var(--text-secondary);
  --focus: var(--text);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --measure: 70ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-md); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/24px var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a { color: var(--link); text-decoration-color: var(--link-line); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--space-md); }
@media (min-width: 40rem) { .wrap { padding: 0 var(--space-lg); } }

.skip {
  position: absolute; left: var(--space-md); top: -4rem; z-index: 10;
  background: var(--surface-inverse); color: var(--text-inverse);
  padding: 10px var(--space-md); border-radius: var(--radius-md); font-weight: 500;
}
.skip:focus { top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--space-md); }
.brand {
  font: 600 22px/1 var(--font-serif); letter-spacing: -0.3px;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.lang { display: flex; align-items: center; gap: var(--space-xs); color: var(--text-muted); font-size: 14px; }
.lang a {
  display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px;
  text-align: center; text-decoration: none; color: var(--fg-2);
  border-radius: var(--radius-pill); font-weight: 500; letter-spacing: 1px;
}
.lang a:hover { color: var(--text); background: var(--surface); }
.lang a[aria-current] { color: var(--text); background: var(--surface); }

/* Main */
main { flex: 1; }
main.wrap { padding-top: var(--space-xl); padding-bottom: var(--space-xxl); }

/* Legal pages */
.prose { max-width: var(--measure); min-width: 0; font-size: 17px; line-height: 26px; }
.prose h1 { font: 600 clamp(30px, 4.5vw, 40px)/1.2 var(--font-serif); letter-spacing: -0.3px; margin: 0 0 var(--space-sm); }
.prose h2 { font: 600 22px/28px var(--font-serif); margin: 40px 0 12px; }
.prose h3 { font: 500 19px/26px var(--font-serif); margin: 28px 0 6px; }
.prose p, .prose ul { margin: 0 0 var(--space-md); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--space-sm); }
.prose li::marker { color: var(--accent); }
.updated { color: var(--fg-2); font-size: 14px; }
.notice, .callout {
  background: var(--surface); color: var(--text);
  padding: var(--space-md) 20px; border-radius: var(--radius-lg); font-size: 15px; line-height: 22px;
  border-left: 3px solid var(--accent);
}
.callout { margin-top: var(--space-xl); }
.imprint { color: var(--fg-2); font-size: 14px; margin-top: var(--space-xl); }

/* Tables: cards on small screens, grid on wider ones */
.table { margin: 0 0 20px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 22px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
th, td { text-align: left; vertical-align: top; padding: 12px var(--space-md); border-top: 1px solid var(--border); }
th { background: var(--surface-elevated); font-weight: 500; border-top: 0; }
td + td, th + th { border-left: 1px solid var(--border); }
@media (max-width: 40rem) {
  table { background: none; border-radius: 0; overflow: visible; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table, tbody, tr, td { display: block; }
  tr { border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; background: var(--surface); }
  td, td + td { border: 0; border-top: 1px solid var(--border); }
  td:first-child { border-top: 0; font-weight: 500; background: var(--surface-elevated); }
  td::before { content: attr(data-label); display: block; font-size: 11px; line-height: 14px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 500; color: var(--fg-2-card); margin-bottom: 2px; }
}

/* Table of contents */
.toc { border-radius: var(--radius-lg); background: var(--surface); margin-bottom: var(--space-lg); }
.toc summary { cursor: pointer; padding: 10px 20px; min-height: 44px; display: flex; align-items: center; gap: var(--space-sm); font-weight: 500; }
.toc summary { list-style: none; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; margin-right: 4px; border-right: 1.5px solid var(--text); border-bottom: 1.5px solid var(--text); transform: rotate(45deg) translateY(-3px); }
.toc[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.toc ol { margin: 0; padding: 0 20px var(--space-md); font-size: 15px; line-height: 22px; list-style: none; }
.toc li { margin: 0; }
.toc a { color: var(--text); text-decoration: none; display: block; padding: 6px 0; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

@media (min-width: 64rem) {
  .doc.has-toc { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: var(--space-xxl); align-items: start; }
  .toc { position: sticky; top: var(--space-md); max-height: calc(100vh - 2rem); overflow-y: auto; margin: 0; }
}

/* 404 */
.home:not(.landing) { max-width: calc(var(--measure) + 2rem); }
.home:not(.landing) h1 { font: 600 clamp(40px, 8vw, 56px)/1.1 var(--font-serif); letter-spacing: -0.4px; margin: var(--space-md) 0 12px; }
.lead { font-size: 19px; line-height: 28px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-lg) 0 var(--space-xl); color: var(--fg-2); font-size: 14px; line-height: 20px; }
.foot-links { list-style: none; padding: 0; margin: 0 0 var(--space-sm); display: flex; flex-wrap: wrap; column-gap: 20px; }
.foot-links a { color: var(--link); display: inline-flex; align-items: center; min-height: 44px; }
.foot-links a:hover, .foot-links a[aria-current] { color: var(--text); }
.site-footer p { margin: 0; }
.site-footer p a { color: var(--link); display: inline-flex; align-items: center; min-height: 44px; }
.foot-notes { margin-top: var(--space-sm) !important; }
.foot-notes span { display: block; }

/* Email confirmation (/email-confirmed/): success by default, error when the
   page script sets data-state="error" on <html> (before first paint). */
.confirm { max-width: 36rem; padding-top: 64px !important; padding-bottom: 72px !important; }
.confirm-over { font: 500 11px/14px var(--font-sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--overline); margin: 0 0 12px; }
.confirm h1 { font: 600 clamp(30px, 6vw, 40px)/1.2 var(--font-serif); letter-spacing: -0.3px; margin: 0 0 var(--space-md); }
.confirm p { font-size: 17px; line-height: 26px; margin: 0 0 var(--space-md); }
.state-error { display: none; }
[data-state="error"] .state-error { display: block; }
[data-state="error"] .state-ok { display: none; }
.confirm-action { margin-top: var(--space-xl) !important; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 28px;
  border-radius: var(--radius-md); background: var(--accent); color: var(--text);
  font: 500 17px/22px var(--font-sans); text-decoration: none;
}
.button:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.confirm-note { color: var(--fg-2); font-size: 14px !important; line-height: 20px !important; }
