/* Aktüel Panorama — warm-beige/burgundy serif magazine */
:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f3ede2;
  --ink: #201612;
  --ink-2: #4c3d34;
  --muted: #8b7867;
  --line: #e7ddcc;
  --accent: #7c2d12;
  --accent-ink: #ffffff;
  --pill-bg: #ede2cc;
  --shadow: 0 1px 2px rgba(50, 30, 15, .05), 0 8px 24px -12px rgba(50, 30, 15, .18);
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1512;
    --surface: #221b17;
    --surface-2: #2a221d;
    --ink: #f0e7d8;
    --ink-2: #c6b6a0;
    --muted: #8a7867;
    --line: #35291f;
    --accent: #d97757;
    --accent-ink: #1a0d05;
    --pill-bg: #2f251e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Iowan Old Style", "Palatino Linotype", "PT Serif", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh; min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Boot loader — vintage newspaper: typewriter masthead + ticker */
#boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink);
  transition: opacity .5s ease-out;
  -webkit-user-select: none; user-select: none;
  overflow: hidden;
}
#boot.hide { opacity: 0; pointer-events: none; }
.boot-paper {
  width: min(420px, 84vw); max-width: 100%;
  padding: 22px 20px; text-align: center;
}
.boot-rule { height: 3px; background: var(--ink); margin: 0 0 12px; }
.boot-rule--thin { height: 1px; margin: 12px 0; opacity: .6; }
.boot-kicker {
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
/* The masthead is static and always complete — no per-character reveal.
   Timer-driven typing was throttled by the webview and left the name clipped;
   motion now comes only from CSS animations below. */
.boot-name {
  font-family: "Iowan Old Style", "PT Serif", Georgia, serif;
  font-size: clamp(17px, 5.2vw, 28px); font-weight: 400; letter-spacing: .5px;
  max-width: 100%; text-align: center;
  animation: boot-name-in .7s ease-out both;
}
.boot-name b { font-weight: 700; }

/* Sheets running off the press */
.boot-press {
  display: flex; justify-content: center; gap: 6px; margin-top: 14px;
}
.boot-press__sheet {
  width: 26px; height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  animation: boot-sheet 1.2s ease-in-out infinite;
}
.boot-press__sheet:nth-child(2) { animation-delay: .18s; }
.boot-press__sheet:nth-child(3) { animation-delay: .36s; }
@keyframes boot-name-in {
  from { opacity: 0; transform: translateY(6px); letter-spacing: 3px; }
  to   { opacity: 1; transform: none; letter-spacing: .5px; }
}
@keyframes boot-sheet {
  0%, 100% { transform: translateY(0); opacity: .45; }
  50%      { transform: translateY(-7px); opacity: 1; }
}
.boot-ticker {
  overflow: hidden; white-space: nowrap; width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; color: var(--muted); letter-spacing: 1px;
}
.boot-ticker__track {
  display: inline-block; padding-left: 100%;
  animation: boot-marquee 5s linear infinite;
}
.boot-note {
  font-style: italic; font-size: 13px; color: var(--ink-2); margin-top: 12px;
  animation: boot-fade 1.2s ease-in-out infinite alternate;
}
@keyframes boot-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes boot-fade { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .boot-ticker__track, .boot-note, .boot-name, .boot-press__sheet { animation: none; }
}

/* Layout differentiation: wide FX hero + 2-column grid for the rest */
@media (min-width: 560px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .card--fx { grid-column: 1 / -1; }   /* piyasa panosu = full-width hero */
}
.card--fx {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0%, var(--surface) 40%);
}
.card--fx .fx-list li { padding: 11px 0; }
.card--fx .fx__value { font-size: 20px; }

.masthead {
  max-width: 720px; margin: 0 auto; padding: 22px 20px 8px;
  border-bottom: 3px double var(--line);
}
.masthead__inner {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark { color: var(--accent); font-size: 22px; }
.brand__name { font-size: 24px; font-weight: 400; letter-spacing: .3px; font-style: italic; }
.brand__name b { font-weight: 700; font-style: normal; }
.masthead__meta { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.masthead__tag {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  font-style: italic;
  padding-top: 6px;
}

.grid {
  max-width: 720px; margin: 8px auto 16px; padding: 12px 20px 0;
  display: grid; gap: 14px;
}
/* Cards must never widen the page: grid items are min-width:auto by default,
   so any unshrinkable child (select, long number) would force a horizontal
   scrollbar on the whole document. */
.grid > .card { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.card__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: "Iowan Old Style", Georgia, serif;
}
.card__foot {
  margin-top: 12px; padding-top: 8px;
  border-top: 1px dotted var(--line);
  font-size: 11px; color: var(--muted); letter-spacing: .3px;
  font-style: italic;
}
.pill {
  background: var(--pill-bg); color: var(--ink-2);
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; letter-spacing: .3px;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

/* FX */
.fx-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
}
.fx-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--line);
  font-variant-numeric: tabular-nums;
}
.fx-list li:last-child { border-bottom: 0; }
.fx__name { font-weight: 700; }
.fx__symbol { color: var(--muted); font-size: 12px; font-style: italic; }
.fx__value { font-size: 18px; font-weight: 700; letter-spacing: -.2px; color: var(--accent); }

/* FX rows gain a sparkline column */
.fx-list li { grid-template-columns: 1fr auto auto; gap: 10px; }
.fx__label { min-width: 0; }
.fx__spark { display: inline-flex; align-items: center; }
.spark { width: 68px; height: 22px; display: block; }
.spark polyline { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark--up polyline { stroke: #15803d; }
.spark--down polyline { stroke: #b91c1c; }
@media (prefers-color-scheme: dark) {
  .spark--up polyline { stroke: #4ade80; }
  .spark--down polyline { stroke: #f87171; }
}

/* ★ Currency converter */
.conv { display: grid; gap: 8px; }
.conv__row {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; align-items: stretch;
}
/* A <select> reports the widest <option> as its min-content, and grid items
   default to min-width:auto — without this the long currency labels push the
   whole card wider than the viewport on small screens. */
.conv__row > *, .gold__row > * { min-width: 0; }
.conv__row select, .gold__row select { max-width: 100%; }
.conv__row input, .conv__row select, .conv__out {
  padding: 10px 12px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; outline: none; width: 100%;
  font-variant-numeric: tabular-nums;
}
.conv__row input:focus, .conv__row select:focus { border-color: var(--accent); }
.conv__out {
  display: flex; align-items: center;
  font-size: 19px; font-weight: 700; color: var(--accent);
  background: var(--pill-bg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv__swap {
  justify-self: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--accent); font-size: 16px; cursor: pointer; line-height: 1;
}
.conv__swap:hover { background: var(--pill-bg); }

/* ★ Gold calculator */
.gold { display: grid; gap: 8px; }
.gold__row {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; align-items: center;
}
.gold__row label { font-size: 13px; color: var(--ink-2); }
.gold__row input, .gold__row select {
  padding: 9px 12px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; outline: none; width: 100%;
}
.gold__row input:focus, .gold__row select:focus { border-color: var(--accent); }
.gold__out {
  margin-top: 2px; padding: 12px;
  background: var(--pill-bg); border-radius: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.gold__value {
  font-size: 22px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}
.gold__hint { font-size: 12px; color: var(--muted); font-style: italic; }

/* Cities */
.cities {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
}
.cities li {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
  align-items: baseline;
}
.cities li:last-child { border-bottom: 0; }
.cities__name { font-weight: 700; }
.cities__val { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* Clocks */
.clocks {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
}
.clocks li {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 9px 0;
  border-bottom: 1px dotted var(--line);
  align-items: baseline;
}
.clocks li:last-child { border-bottom: 0; }
.clocks__city { font-weight: 700; }
.clocks__time {
  font-size: 20px; font-weight: 700; letter-spacing: -.4px;
  font-variant-numeric: tabular-nums; color: var(--accent);
  font-family: "Iowan Old Style", Georgia, serif;
}

/* Calculator */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  font: inherit; font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: transparent; color: var(--ink-2);
  cursor: pointer;
}
.tab.is-active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel label {
  display: block; margin-bottom: 10px;
  font-size: 13px; color: var(--ink-2);
}
.tab-panel input, .tab-panel select {
  display: block; margin-top: 4px; width: 100%;
  padding: 9px 12px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; outline: none;
}
.tab-panel input:focus, .tab-panel select:focus { border-color: var(--accent); }
.calc-out {
  margin-top: 8px; padding: 10px 12px;
  background: var(--pill-bg); border-radius: 4px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--pill-bg) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: pulse 1.4s ease-in-out infinite;
  color: transparent;
}
.skeleton--row { height: 24px; margin: 6px 0; }
@keyframes pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.foot {
  max-width: 720px; margin: 8px auto 24px;
  padding: 14px 20px 20px;
  color: var(--ink-2);
  border-top: 3px double var(--line);
  font-size: 12px; font-style: italic;
}
.foot p { margin: 0 0 3px; }
.foot__muted { color: var(--muted); }

@media (max-width: 380px) {
  .masthead__inner { flex-direction: column; align-items: flex-start; }
  .clocks__time, .fx__value { font-size: 16px; }
}
