/*
 * OpenRTI — özgün platform yüzü tasarım sistemi.
 * Sıcak kâğıt zemin + terracotta aksan, serif başlık / sans gövde. Bağımlılıksız.
 */

:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --card: #fffdf8;
  --ink: #24272e;
  --ink-soft: #565a63;
  --muted: #7a7e88;
  --accent: #b8502e;
  --accent-deep: #8f3d22;
  --accent-soft: #f0dfd5;
  --line: #e4dccd;
  --line-strong: #d3c8b3;
  --dome: #14161c;      /* viewer koyu teması */
  --ok: #3f7d54;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(60, 45, 30, .05), 0 8px 24px -12px rgba(60, 45, 30, .18);
  --shadow-lg: 0 2px 6px rgba(60, 45, 30, .08), 0 22px 48px -20px rgba(60, 45, 30, .30);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.muted { color: var(--muted); }

/* ---- düğmeler ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 15px/1 var(--sans); padding: 12px 20px; border-radius: 10px;
  border: 1px solid transparent; transition: transform .06s ease, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- gezinme ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--accent); flex: none; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--accent-deep); text-decoration: none; }
.nav-spacer { flex: 1; }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

/* ---- hero ---- */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.4vw, 52px); margin: 0 0 20px; }
.hero p.lede { font-size: 19px; color: var(--ink-soft); margin: 0 0 28px; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 20px; font-size: 13.5px; color: var(--muted); }

/* ---- vitrin viewer kartı ---- */
.showcase {
  background: var(--dome); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid #2a2f3d;
}
.showcase-stage { position: relative; aspect-ratio: 4 / 3; background: #101218; }
.showcase-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.showcase-stage canvas:active { cursor: grabbing; }
.showcase-hint {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 7px;
  background: rgba(20, 22, 28, .72); color: #e8e6e1; border: 1px solid #3a4152;
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; pointer-events: none;
  transition: opacity .4s;
}
.showcase-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: #191c25; color: #c7cbd6; font-size: 13px;
  border-top: 1px solid #2a2f3d;
}
.showcase-bar a { color: var(--accent); font-weight: 600; }
.showcase-modes { display: flex; gap: 6px; }
.showcase-modes button {
  background: none; border: 1px solid #3a4152; color: #c7cbd6; cursor: pointer;
  border-radius: 6px; padding: 4px 9px; font-size: 12px;
}
.showcase-modes button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ---- dramatik karanlık hero (müze / dijital ışık) ---- */
.hero-dark {
  position: relative; overflow: hidden;
  background: radial-gradient(115% 92% at 70% 24%, #26232d 0%, #17181f 48%, #0e0f14 100%);
  color: #ece9e3; padding: 82px 0 90px; border-bottom: 1px solid #22242c;
}
.hero-dark .wrap { position: relative; z-index: 1; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 52% at 71% 45%, rgba(203,111,58,.24), transparent 70%);
}
.hero-dark .hero-grid { grid-template-columns: 1fr 1.08fr; gap: 52px; }
.hero-dark .eyebrow { color: #ecb488; }
.hero-dark h1 { color: #f5f2ec; font-size: clamp(40px, 5.2vw, 64px); letter-spacing: -.02em; }
.hero-dark .lede { color: #bdb8b0; font-size: 20px; max-width: 32ch; }
.hero-dark .hero-note { color: #83807a; }
.hero-dark .btn-ghost { color: #ece9e3; border-color: #40454f; }
.hero-dark .btn-ghost:hover { color: #fff; border-color: var(--accent); }
.showcase-hero {
  box-shadow: 0 34px 90px -34px rgba(0,0,0,.75), 0 0 0 1px #2b303d,
              0 0 120px -28px rgba(210,120,60,.42);
}
.showcase-hero .showcase-stage { aspect-ratio: 3 / 2; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ffd23e; flex: none;
  box-shadow: 0 0 0 0 rgba(255,210,62,.6); animation: pulse 2.1s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,210,62,.55); }
  70% { box-shadow: 0 0 0 8px rgba(255,210,62,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,210,62,0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
@media (max-width: 900px) {
  .hero-dark .hero-grid { grid-template-columns: 1fr; }
  .hero-dark .lede { max-width: none; }
}

/* ---- bölüm başlıkları ---- */
section { padding: 56px 0; }
.section-head { max-width: 62ch; margin: 0 0 36px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 12px; }
.section-head p { font-size: 17px; color: var(--ink-soft); margin: 0; }
.band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---- nasıl çalışır ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); position: relative;
}
.step .num {
  font-family: var(--serif); font-size: 15px; color: var(--accent);
  border: 1px solid var(--accent-soft); background: var(--accent-soft);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 16px;
}
.step .icon { color: var(--accent); margin-bottom: 14px; }
.step h3 { font-size: 19px; margin: 0 0 8px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---- koleksiyon kartları ---- */
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ccard {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .15s;
}
a.ccard:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ccard-thumb { aspect-ratio: 16 / 10; background: var(--paper-2); position: relative; overflow: hidden; }
.ccard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard-thumb .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, #cdbfa6 0%, #a89170 55%, #6f5c3f 100%);
  color: #fff8ec; font-family: var(--serif); font-size: 15px; letter-spacing: .04em;
}
.ccard-tag {
  position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 600;
  background: rgba(20,22,28,.62); color: #fff; padding: 3px 9px; border-radius: 999px;
  letter-spacing: .03em;
}
.ccard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ccard-body h3 { font-size: 18px; margin: 0; color: var(--ink); }
.ccard-inst { font-size: 13.5px; color: var(--muted); }
.ccard-meta { margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--ink-soft); display: flex; gap: 12px; }

/* ---- CTA şeridi ---- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 12px; }
.cta-band p { font-size: 17px; color: var(--ink-soft); margin: 0 auto 24px; max-width: 52ch; }

/* ---- footer ---- */
.site-footer { background: var(--dome); color: #c3c7d1; padding: 52px 0 30px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #f2efe8; margin-bottom: 12px; }
.site-footer p { color: #969ba8; font-size: 14px; margin: 0; max-width: 34ch; }
.footer-col h4 { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #808696; margin: 0 0 14px; }
.footer-col a { display: block; color: #c3c7d1; font-size: 14.5px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid #2a2f3d;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #7f8593;
}

/* ---- koleksiyonlar sayfası ---- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 40px); margin: 0 0 8px; }
.page-head p { color: var(--ink-soft); font-size: 17px; margin: 0; }
.browse { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 28px 0 64px; align-items: start; }
.filters { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.filters h2 { font-size: 15px; font-family: var(--sans); font-weight: 700; margin: 0 0 14px; }
.filter-group { border: 0; border-top: 1px solid var(--line); margin: 0; min-inline-size: 0; padding: 14px 0 4px; }
.filter-group:first-of-type { border-top: 0; padding-top: 0; }
.filter-group legend, .filter-group .lg { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding: 0; }
.filter-opt { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-soft); padding: 4px 0; cursor: pointer; }
.filter-opt input { accent-color: var(--accent); width: 15px; height: 15px; }
.browse-main .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.browse-main .toolbar .count { color: var(--muted); font-size: 14.5px; }
.browse-main select { font: inherit; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); }

/* ---- form / yükleme ---- */
.form-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start; padding: 8px 0 64px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--card); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 76px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-box + .card-box { margin-top: 20px; }
.card-box h2 { font-family: var(--sans); font-size: 15px; font-weight: 700; margin: 0 0 16px; }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2);
  padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { color: var(--accent); margin-bottom: 10px; }
.dropzone strong { display: block; font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.dropzone .dz-sub { font-size: 13px; color: var(--muted); }
.file-pill {
  display: none; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
}
.file-pill.show { display: flex; }
.file-pill .fp-name { font-weight: 600; }
.file-pill .fp-remove { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }

.progressbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.progressbar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* işleme aşamaları */
.stages { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stages li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--muted); }
.stages .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 12px; }
.stages li[data-state="active"] { color: var(--ink); }
.stages li[data-state="active"] .dot { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.stages li[data-state="done"] { color: var(--ink); }
.stages li[data-state="done"] .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.stages li[data-state="error"] { color: var(--accent-deep); }
.stages li[data-state="error"] .dot { border-color: var(--accent-deep); background: var(--accent-deep); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stages li[data-state="active"] .dot { animation: none; } }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-top: 14px; }
.alert-err { background: #fbe9e4; border: 1px solid #e7b7a7; color: #8f3d22; }
.alert-ok { background: #e7f2ea; border: 1px solid #b3d6bf; color: #2c6a41; }

/* ---- eser detay sayfası ---- */
.artifact-head { padding: 34px 0 18px; border-bottom: 1px solid var(--line); }
.artifact-head .kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.artifact-head h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 0; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.badge-draft { background: #efe3cf; color: #8a6d2f; }
.badge-review { background: #e7ecf7; color: #3a5a9a; }
.badge-published { background: #e7f2ea; color: #2c6a41; }
.badge-license { background: var(--accent-soft); color: var(--accent-deep); }
.badge-ghost { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line); }

.detail-split { display: grid; grid-template-columns: 1fr 360px; gap: 26px; padding: 24px 0 56px; align-items: start; }
.viewer-frame { border: 1px solid #2a2f3d; border-radius: var(--radius); overflow: hidden; background: var(--dome); box-shadow: var(--shadow-lg); aspect-ratio: 4 / 3; }
.viewer-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 720px) { .viewer-frame { aspect-ratio: 3 / 4; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-soft);
  font: 600 14px/1 var(--sans); padding: 10px 12px; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--accent-deep); border-bottom-color: var(--accent); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }
dl.meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
dl.meta dt { color: var(--muted); font-weight: 600; }
dl.meta dd { margin: 0; color: var(--ink); }

.cite-tools { display: flex; gap: 6px; margin-bottom: 12px; }
.cite-tools button { background: none; border: 1px solid var(--line-strong); color: var(--ink-soft); border-radius: 7px; padding: 6px 12px; font: 600 13px/1 var(--sans); cursor: pointer; }
.cite-tools button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.cite-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font: 13px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.copy-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.copy-msg { font-size: 13px; color: var(--ok); }

@media (max-width: 900px) {
  .form-grid, .detail-split { grid-template-columns: 1fr; }
  .detail-split { gap: 20px; }
}

/* ---- erişilebilirlik yardımcıları ---- */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 50; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- duyarlı ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero p.lede { max-width: none; }
  .steps, .grid-cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
  }
  .nav-links.open a { padding: 10px 0; }
  .nav-toggle { display: inline-grid; place-items: center; background: none; border: 1px solid var(--line-strong); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; color: var(--ink); }
  .steps, .grid-cards, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 44px; }
  section { padding: 44px 0; }
}

/* Statik yayın (canlı site): yükleme backend gerektirir, bağlantıları gizlenir. */
[data-mode="static"] .needs-api { display: none !important; }
