/* znclabs learn — shared design tokens + base components (PHP rebuild) */
:root {
  color-scheme: light;
  /* "öğrenme pasaportu" — açık pasaport */
  --page: #f3efe4;
  --surface: #faf7ef;
  --ink-primary: #1c2b4a;
  --ink-secondary: #3a4a6b;
  --ink-muted: #5c6a80;
  --border: #ddd2b4;
  --border-strong: #c7b98f;
  --accent: #8a6224;
  --accent-bright: #c99a45;
  --accent-ink: #fff;
  --secondary: #3a5a7a;
  --secondary-ink: #fff;
  --good: #2b6e5c;
  --bad: #b8402f;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;
  --radius-md: .25rem;
  --radius-lg: .375rem;
  --radius-xl: .5rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* karanlık pasaport */
  --page: #0f1830;
  --surface: #17223e;
  --ink-primary: #ede6d3;
  --ink-secondary: #b7ac93;
  --ink-muted: #9a9280;
  --border: #2a3554;
  --border-strong: #3e4a70;
  --accent: #d4a94f;
  --accent-bright: #e6c26e;
  --accent-ink: #1f1608;
  --secondary: #3f6b96;
  --secondary-ink: #fff;
  --good: #4fae93;
  --bad: #e0705c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f1830;
    --surface: #17223e;
    --ink-primary: #ede6d3;
    --ink-secondary: #b7ac93;
    --ink-muted: #9a9280;
    --border: #2a3554;
    --border-strong: #3e4a70;
    --accent: #d4a94f;
    --accent-bright: #e6c26e;
    --accent-ink: #1f1608;
    --secondary: #3f6b96;
    --secondary-ink: #fff;
    --good: #4fae93;
    --bad: #e0705c;
  }
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius-md) 0; font-weight: 700; font-size: .875rem;
}
.skip-link:focus { left: 0; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink-primary);
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }

.wrap { margin: 0 auto; width: 100%; max-width: 56rem; padding: 0 1rem; }
.wrap-lg { margin: 0 auto; width: 100%; max-width: 72rem; padding: 0 1rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
}
.site-header .row { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; }
.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink-primary); }
.brand svg { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.brand .accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; margin-left: 1.5rem; flex-shrink: 0; }
.nav-links a { font-size: .875rem; font-weight: 600; color: var(--ink-secondary); white-space: nowrap; }
.header-actions { flex-shrink: 0; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.nav-toggle { display: none; order: -1; margin-left: 0; margin-right: .5rem; background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: .4rem; cursor: pointer; color: var(--ink-primary); }
.nav-toggle svg { width: 1.25rem; height: 1.25rem; display: block; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; margin-left: .75rem;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 999px;
  width: 2.25rem; height: 2.25rem; padding: 0; cursor: pointer; color: var(--ink-primary); flex-shrink: 0;
}
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}

#sound-toggle { margin-left: .4rem; }
#sound-toggle .icon-sound-off { display: none; }
#sound-toggle.sound-muted .icon-sound-on { display: none; }
#sound-toggle.sound-muted .icon-sound-off { display: block; }
#sound-toggle.sound-muted { opacity: .55; }
.nav-links-mobile { display: none; flex-direction: column; border-top: 1px solid var(--border); }
.nav-links-mobile.open { display: flex; }
.nav-links-mobile a { padding: .8rem 1rem; font-size: .95rem; font-weight: 600; color: var(--ink-secondary); border-bottom: 1px solid var(--border); }
.nav-links-mobile a.active { color: var(--accent); }

.nav-links-mobile-actions { display: none; flex-wrap: wrap; gap: .6rem; padding: .9rem 1rem 1.1rem; }
.nav-links-mobile-actions .btn { flex: 1; text-align: center; justify-content: center; }

.header-daily-ring {
  position: relative; width: 2.15rem; height: 2.15rem; flex-shrink: 0; margin-left: .1rem;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
}
.header-daily-ring .ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.header-daily-ring .ring-svg circle:last-child { transition: stroke-dashoffset .3s ease; }
.header-daily-ring .ring-num { position: relative; z-index: 1; font-family: var(--font-mono); font-size: .68rem; font-weight: 700; color: var(--ink-primary); }
.nav-links-mobile-actions .header-daily-ring { flex: none; order: -1; }

/* avatar damgası — header, liderlik tablosu ve profilde paylaşılan pasaport-stili yuvarlak rozet */
.avatar-stamp {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; flex-shrink: 0;
  border: 2px dashed var(--border-strong); background: var(--surface); line-height: 1;
}
.avatar-stamp.filled { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.avatar-stamp-sm { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
.avatar-stamp-lg { width: 3.1rem; height: 3.1rem; font-size: 1.6rem; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.avatar-picker button { padding: 0; border: none; background: none; cursor: pointer; border-radius: 999px; }
.avatar-picker button .avatar-stamp { transition: transform .12s ease, border-color .12s ease; }
.avatar-picker button:hover .avatar-stamp { transform: translateY(-2px); border-color: var(--accent); }
.avatar-picker button.selected .avatar-stamp { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }

.site-search-desktop { position: relative; }
.site-search-panel { display: none; position: absolute; top: calc(100% + .6rem); right: 0; width: min(21rem, 90vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 16px 40px -16px rgba(0,0,0,.32); padding: .75rem; z-index: 60; }
.site-search-panel.open { display: block; }
.site-search-mobile { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.site-search-input { width: 100%; border: 1.5px solid var(--border); border-radius: 999px; padding: .55rem 1rem; font-size: .85rem; background: var(--page); color: var(--ink-primary); font-family: inherit; }
.site-search-input:focus { outline: none; border-color: var(--accent); }
.site-search-results { margin-top: .5rem; max-height: 18rem; overflow-y: auto; }
.site-search-results:empty { margin-top: 0; }
.site-search-group-label { font-family: var(--font-mono); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); padding: .35rem .5rem .25rem; }
.site-search-item { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .5rem .6rem; border-radius: var(--radius-md); text-decoration: none; color: inherit; }
.site-search-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.site-search-item .en { font-weight: 700; font-size: .88rem; }
.site-search-item .tr { color: var(--ink-muted); font-size: .78rem; white-space: nowrap; }
.site-search-empty { padding: .6rem; font-size: .8rem; color: var(--ink-muted); text-align: center; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header-actions { display: none; }
  .nav-links-mobile-actions.open { display: flex; }
  .site-search-desktop { display: none; }
}
@media (max-width: 400px) {
  .site-header .row { gap: .5rem; }
  .theme-toggle { width: 2rem; height: 2rem; margin-left: .35rem; }
  #sound-toggle { margin-left: .3rem; }
  .brand span { font-size: .95rem; }
}
@media (min-width: 721px) {
  .nav-links-mobile { display: none !important; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: var(--radius-lg); padding: .55rem 1.1rem; font-size: .875rem; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; transition: opacity .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 10px -3px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-accent:hover { opacity: .95; transform: translateY(-1px); box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-accent:active { transform: translateY(0) scale(0.98); }
.btn-outline { background: transparent; color: var(--ink-primary); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-secondary { background: var(--secondary); color: var(--secondary-ink); box-shadow: 0 3px 10px -3px color-mix(in srgb, var(--secondary) 55%, transparent); }
.btn-secondary:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-block { width: 100%; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pad { padding: 1.25rem; }
.pad-lg { padding: 2rem; }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 60%, transparent); margin-top: auto; }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(3, 1fr); padding: 2.5rem 0; }
.site-footer h2 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-secondary); margin: 0 0 .75rem; }
.site-footer .links { display: flex; flex-direction: column; gap: .5rem; }
.site-footer .links a { font-size: .875rem; color: var(--ink-muted); }
.site-footer .links a:hover { color: var(--accent); }
.site-footer .bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--border); padding: 1.5rem 0; font-size: .75rem; color: var(--ink-muted); }
.site-footer .bottom a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* app-like bottom tab bar (mobile only) */
.app-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom, 0px));
}
.app-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  padding: .3rem 0; border-radius: var(--radius-md); color: var(--ink-muted); transition: color .12s ease;
}
.app-tabbar a svg { width: 1.35rem; height: 1.35rem; }
.app-tabbar a span { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .02em; }
.app-tabbar a.active { color: var(--accent); }
.app-tabbar a:active { transform: scale(.94); }
@media (max-width: 720px) {
  .app-tabbar { display: flex; }
  body { padding-bottom: calc(3.9rem + env(safe-area-inset-bottom, 0px)); }
}

/* generic */
.eyebrow { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.muted { color: var(--ink-secondary); }
.text-xs { font-size: .75rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.center { text-align: center; }
.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); font-size: .75rem; font-weight: 700; padding: .25rem .65rem; }

/* forms */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .8rem; font-weight: 700; color: var(--ink-secondary); }
.field input {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: .7rem .9rem;
  font-size: .95rem; background: var(--surface); color: var(--ink-primary); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field-error { font-size: .78rem; color: var(--bad); margin-top: -.2rem; }
.pw-strength { margin-top: .5rem; }
.pw-strength-track { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pw-strength-fill { height: 100%; border-radius: 999px; width: 0%; transition: width .2s ease, background .2s ease; }
.pw-strength-label { font-size: .72rem; color: var(--ink-muted); margin-top: .3rem; display: block; font-weight: 700; }
.form-alert { border-radius: var(--radius-lg); padding: .7rem .9rem; font-size: .85rem; margin-bottom: 1rem; }
.form-alert.error { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--border)); }
.form-alert.success { background: color-mix(in srgb, var(--good) 12%, var(--surface)); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, var(--border)); }

.auth-wrap { max-width: 26rem; margin: 3rem auto; padding: 0 1rem; }
.auth-wrap h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .4rem; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--ink-muted); font-size: .875rem; margin-bottom: 1.75rem; }
.auth-wrap .switch { text-align: center; font-size: .85rem; color: var(--ink-muted); margin-top: 1.25rem; }
.auth-wrap .switch a { color: var(--accent); font-weight: 700; }
