/* u: a reading deck. Warm paper, ink, one vermilion accent. Mobile first. */
:root {
  --paper: #f3eee4;
  --paper-2: #ebe4d6;
  --card: #fbf8f2;
  --ink: #1d1a16;
  --ink-2: #4f483f;
  --ink-3: #776f62;
  --rule: #d9d0bf;
  --accent: #df4527;
  --accent-ink: #fff8f2;
  --accent-soft: #f6d9cf;
  --ok: #2f7a4f;
  --shadow: 0 1px 0 rgba(60, 40, 10, .06), 0 10px 30px -12px rgba(60, 40, 10, .25);
  --dock-h: 76px;
  --serif: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141311;
    --paper-2: #1c1a17;
    --card: #1e1c19;
    --ink: #ece5d8;
    --ink-2: #c2b9a9;
    --ink-3: #958c7c;
    --rule: #34302a;
    --accent: #ff6a4a;
    --accent-ink: #1a0c07;
    --accent-soft: #3a1f17;
    --ok: #6cc28f;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141311; --paper-2: #1c1a17; --card: #1e1c19; --ink: #ece5d8; --ink-2: #c2b9a9; --ink-3: #958c7c;
  --rule: #34302a; --accent: #ff6a4a; --accent-ink: #1a0c07; --accent-soft: #3a1f17; --ok: #6cc28f;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: .005em;
  /* The page itself never scrolls: only #scroller does. Scrolling the document
     makes mobile browsers show/hide their toolbars, which resizes the viewport
     and makes the bottom dock jump on every "Sıradaki". */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
html { height: 100%; overflow: hidden; overscroll-behavior: none; }
.scroller {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-bottom: 32px; outline: none;
}
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* reading progress */
#progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 30;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- top ---------- */
.top {
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 4px;
}
.logo {
  font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1;
  color: var(--accent); text-decoration: none; letter-spacing: -.04em;
  font-variation-settings: "opsz" 144; padding-bottom: 6px;
}
.filter {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--rule); background: transparent; border-radius: 999px;
  padding: 6px 12px 6px 14px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--ink-2);
}
.filter span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.filter svg { width: 12px; height: 12px; flex: none; }
.tally { margin-left: auto; display: flex; align-items: baseline; gap: 5px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.tally b { font-family: var(--serif); font-size: 22px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; }

/* ---------- stage ---------- */
#stage { max-width: 720px; margin: 0 auto; padding: 8px 16px 0; outline: none; }
.item { transition: transform .18s ease, opacity .18s ease; }
.item.leave-left { transform: translateX(-28px); opacity: 0; }
.item.leave-right { transform: translateX(28px); opacity: 0; }
.item.enter-right { animation: enterR .26s cubic-bezier(.2, .8, .2, 1); }
.item.enter-left { animation: enterL .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes enterR { from { transform: translateX(32px); opacity: 0; } }
@keyframes enterL { from { transform: translateX(-32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .item, .item.enter-right, .item.enter-left { transition: none; animation: none; }
}

.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-3); margin: 14px 0 10px;
}
.meta .src { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; text-decoration: none; max-width: 100%; }
.meta .src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .ico {
  width: 20px; height: 20px; border-radius: 5px; flex: none; background: var(--paper-2);
  display: inline-grid; place-items: center; font-size: 11px; color: var(--ink-2); overflow: hidden;
}
.meta .ico img { width: 100%; height: 100%; object-fit: cover; }
.meta .dot { opacity: .5; }
.badge {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 4px; padding: 1px 6px; background: var(--paper-2); color: var(--ink-2);
}
.badge.read { background: var(--accent-soft); color: var(--accent); }

h1.title {
  font-family: var(--serif); font-weight: 750; font-size: clamp(25px, 6.8vw, 36px);
  line-height: 1.18; letter-spacing: -.012em; margin: 0 0 12px; overflow-wrap: anywhere;
}
h1.title a { color: inherit; text-decoration: none; }
.byline { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 0 0 18px; }

/* article body */
.body { overflow-wrap: anywhere; }
.body > :first-child { margin-top: 0; }
.body p { margin: 0 0 1em; }
.body a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.body img, .body video { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 1em 0; background: var(--paper-2); }
.body figure { margin: 1.2em 0; }
.body figcaption { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.body blockquote { margin: 1em 0; padding: .1em 0 .1em 16px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.body h1, .body h2, .body h3, .body h4 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 1.4em 0 .5em; letter-spacing: -.01em; }
.body h1 { font-size: 1.4em; } .body h2 { font-size: 1.25em; } .body h3, .body h4 { font-size: 1.08em; }
.body pre { overflow-x: auto; background: var(--paper-2); padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.body code { font-family: var(--mono); font-size: .86em; }
.body :not(pre) > code { background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
.body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; margin: 1em 0; }
.body td, .body th { border: 1px solid var(--rule); padding: 6px 8px; }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.body ul, .body ol { padding-left: 1.3em; }
.body .embed { position: relative; aspect-ratio: 16 / 9; margin: 0 -16px 1.2em; background: #000; }
.body .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 760px) { .body .embed { margin: 0 0 1.2em; border-radius: 12px; overflow: hidden; } }
.body audio { width: 100%; margin: .6em 0 1em; }
.body.plain { font-size: 20px; }
.item >
.endmark { display: flex; align-items: center; gap: 12px; color: var(--ink-3); margin: 28px 0 14px; }
.endmark::before, .endmark::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.endmark span { font-family: var(--display); font-size: 20px; color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font-family: var(--mono); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.act:active { transform: scale(.97); }
.act.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.act.danger { color: var(--accent); border-color: var(--accent); }
.act[disabled] { opacity: .5; cursor: progress; }
.act.chosen { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- cards (kind: card), e.g. pushed items with buttons ---------- */
.card {
  position: relative; background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 20px 20px; margin-top: 14px; border: 1px solid var(--rule);
}
.card::before {
  /* a perforated edge: this is a ticket, not an article */
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 6px;
  background: radial-gradient(circle at 5px 0, var(--paper) 4px, transparent 4.5px) 0 0 / 14px 6px repeat-x;
}
.card .meta { margin-top: 0; }
.card h1.title { font-size: clamp(25px, 6.6vw, 34px); }
.card .body { font-size: 18px; }
.card .img { width: calc(100% + 40px); margin: -4px -20px 16px; max-height: 50vh; object-fit: cover; display: block; }
.card .actions { flex-direction: column; margin-top: 18px; }
.card .act { width: 100%; min-height: 52px; font-size: 15px; border-radius: 14px; }
.stamp {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ok); border: 1.5px solid var(--ok); border-radius: 6px; padding: 4px 9px; transform: rotate(-1.5deg);
}

/* ---------- empty / error ---------- */
.empty { text-align: center; padding: 12vh 8px 0; }
.empty .big {
  font-family: var(--display); font-weight: 800; font-size: 160px; line-height: .8; color: var(--accent);
  letter-spacing: -.06em; font-variation-settings: "opsz" 144;
}
.empty h1 { font-family: var(--serif); font-weight: 750; font-size: 28px; margin: 26px 0 6px; }
.empty p { color: var(--ink-2); margin: 0 0 22px; }
/* the snoozed list under "all done" */
.snoozed { text-align: left; margin: 44px 0 24px; }
.snoozed:empty { display: none; }
.snoozed h2 {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.snoozed h2 small { font-size: 12px; color: var(--accent); }
.snoozed ul { list-style: none; margin: 0; padding: 0; }
.snoozed li + li { border-top: 1px dashed var(--rule); }
.snoozed button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-align: left;
  background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer;
}
.snoozed button:hover .sz-main b { text-decoration: underline; text-underline-offset: 3px; }
.snoozed .ico {
  width: 26px; height: 26px; border-radius: 7px; flex: none; background: var(--paper-2);
  display: inline-grid; place-items: center; font-size: 12px; color: var(--ink-2); overflow: hidden;
}
.snoozed .ico img { width: 100%; height: 100%; object-fit: cover; }
.sz-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sz-main b { font-weight: 650; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sz-main small { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sz-when { flex: none; font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.skeleton { padding-top: 18px; }
.skeleton i { display: block; height: 14px; border-radius: 6px; background: var(--paper-2); margin: 10px 0; animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton i.t { height: 34px; width: 85%; margin: 18px 0 24px; }
@keyframes pulse { to { opacity: .45; } }

/* ---------- dock ---------- */
.dock {
  position: relative; flex: none; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px max(16px, calc((100vw - 720px) / 2 + 16px)) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-top: 1px solid var(--rule);
}
.round {
  width: 54px; height: 54px; flex: none; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--card); display: grid; place-items: center; color: var(--ink);
  transition: transform .08s ease;
}
.round svg { width: 22px; height: 22px; }
.round:active { transform: scale(.94); }
.round[disabled] { opacity: .35; cursor: default; }
.next {
  flex: 1; min-width: 0; height: 56px; border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; gap: 10px; padding: 0 18px 0 22px; text-align: left;
  box-shadow: 0 8px 20px -10px var(--accent);
  transition: transform .08s ease, filter .15s ease;
}
.next:active { transform: scale(.98); filter: brightness(.95); }
.next-label { font-family: var(--serif); font-weight: 750; font-size: 20px; }
.next-sub { font-family: var(--mono); font-size: 11.5px; opacity: .8; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next svg { width: 24px; height: 24px; flex: none; }
.next[disabled] { opacity: .5; }
.next.locked { opacity: .82; cursor: default; }

/* an item back from snooze: two choices instead of "next" */
.decide {
  flex: 1; min-width: 0; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--serif); font-weight: 750; font-size: 17px; padding: 0 12px; white-space: nowrap;
  transition: transform .08s ease, filter .15s ease;
}
.decide svg { width: 22px; height: 22px; flex: none; }
.decide:active { transform: scale(.97); }
.decide.again { background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); }
.decide.done { background: var(--ok); color: #fff; border: 0; box-shadow: 0 8px 20px -10px var(--ok); }
.dock.deciding::before {
  content: "Ertelemeden döndü · karar ver"; position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -8px);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 999px; pointer-events: none;
}
.decide.done.armed { filter: brightness(1.15); transform: scale(.97); }
.decide small { font-family: var(--mono); font-weight: 400; font-size: 10.5px; opacity: .8; letter-spacing: .04em; }
.decide .lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.dock.nudge .decide { animation: nudge .38s ease; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(15, 10, 5, .45); animation: fade .2s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 8px 16px calc(22px + env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
  max-width: 720px; margin: 0 auto;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--rule); margin: 4px auto 14px; }
.sheet h2 { font-family: var(--serif); font-size: 26px; font-weight: 750; margin: 0 0 14px; }
.sheet h3 { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 22px 0 8px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px; border: 1px solid var(--rule); background: var(--card);
  border-radius: 999px; padding: 9px 14px; font-family: var(--serif); font-size: 16px; min-height: 42px;
}
.chip small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.seg { display: flex; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--card); padding: 11px 8px; font-family: var(--mono); font-size: 12.5px; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.sheet-foot { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin: 22px 0 0; }
.logout { margin-top: 18px; padding: 10px 0; background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.logout:hover { color: var(--ink); }

/* snooze sheet */
.sheet-sub { margin: -8px 0 16px; color: var(--ink-2); font-size: 16px; }
.snooze-rel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.snooze-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 58px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card); padding: 6px 4px;
}
.snooze-chip b { font-size: 16.5px; font-weight: 700; }
.snooze-chip small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.snooze-chip:active { transform: scale(.97); }
.snooze-opts { display: grid; gap: 8px; }
.snooze-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 50px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card);
  text-align: left; font-family: var(--serif); font-size: 17px;
}
.snooze-opt small { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.snooze-opt:active { transform: scale(.98); }
.snooze-custom { display: flex; gap: 8px; }
.snooze-custom input {
  flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 1px solid var(--rule); background: var(--card);
  color: var(--ink); font-family: var(--mono); font-size: 15px; padding: 0 12px;
}
.badge.snooze { background: transparent; border: 1px solid var(--rule); cursor: pointer; }
.dock .round { width: 50px; height: 50px; }

/* ---------- password ---------- */
.lock {
  position: fixed; inset: 0; z-index: 60; background: var(--paper);
  display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.lock-box { width: 100%; max-width: 320px; text-align: center; }
.lock .big {
  font-family: var(--display); font-weight: 800; font-size: 120px; line-height: .8; color: var(--accent);
  letter-spacing: -.06em; font-variation-settings: "opsz" 144;
}
.lock-msg { color: var(--ink-2); margin: 26px 0 18px; }
.lock-msg.bad { color: var(--accent); font-weight: 600; }
.lock-form { display: flex; gap: 8px; }
.lock-form input {
  flex: 1; min-width: 0; min-height: 52px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card);
  color: var(--ink); font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; padding: 0 12px;
}
.lock-form .act { min-height: 52px; min-width: 84px; font-size: 16px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 14px); z-index: 50;
  transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 10px 14px;
  font-family: var(--mono); font-size: 13px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); animation: up .2s ease;
}
.toast button { background: none; border: 0; color: var(--accent); font-family: var(--mono); font-weight: 600; padding: 4px; }

@media (min-width: 760px) {
  body { font-size: 19px; }
  .top { padding-top: 22px; }
  #stage { padding-top: 18px; }
}

@media (max-width: 400px) {
  .next-sub { display: none; }
  .next { justify-content: space-between; }
}
