@font-face { font-family: 'Literata'; src: url(../fonts/literata.woff) format('woff'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url(../fonts/literata-italic.woff) format('woff'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(../fonts/caveat.woff) format('woff'); font-weight: 400 700; font-display: swap; }

:root {
  --kagit: #f8f8f1;
  --kagit-golge: #e7e6db;
  --cizgi: #bfd3e4;
  --kenar: #e0675a;
  --murekkep: #22307a;      /* mavi tükenmez */
  --kursun: #2c2a33;        /* anlatı */
  --soluk: #6a6878;
  --gece: #14203d;
  --takvim-kirmizi: #c8312b;
  --sari-not: #fbe7a1;
  --satir: 1.75rem;         /* defter çizgisi aralığı */
  --yazi: 1.06rem;
  --el: 'Caveat', 'Segoe Print', cursive;
  --serif: 'Literata', Georgia, serif;
  --safe-alt: env(safe-area-inset-bottom, 0px);
  --safe-ust: env(safe-area-inset-top, 0px);
}
:root.buyuk { --yazi: 1.2rem; --satir: 2rem; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--gece); color: var(--kursun); }
body { font-family: var(--serif); font-size: var(--yazi); -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px dashed var(--murekkep); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.ekran { position: fixed; inset: 0; display: none; }
.ekran.aktif { display: block; }

.el { font-family: var(--el); font-weight: 600; }

/* ---------- Ana menü ---------- */
.giris-sahne, .giris-sahne svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.giris-sahne::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 22, 50, 0) 30%, rgba(20, 22, 50, .55) 75%, rgba(20, 22, 50, .8)); }
.giris-icerik { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px calc(36px + var(--safe-alt)); display: grid; justify-items: center; text-align: center; }
.baslik { font-family: var(--el); font-weight: 700; font-size: clamp(4.6rem, 18vw, 8.5rem); line-height: .85; margin: 0; color: #fff8e8; text-shadow: 0 2px 0 rgba(120, 50, 30, .35), 0 8px 30px rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.altbaslik { font-style: italic; color: #f6dfc4; margin: .6rem 0 1.6rem; letter-spacing: .02em; }
.giris-menu { display: grid; gap: 2px; justify-items: center; }
.giris-menu .el { font-size: 1.9rem; color: #fff6e6; padding: 4px 14px; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); position: relative; }
.giris-menu .el::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s; opacity: .8; }
.giris-menu .el:hover::after, .giris-menu .el:focus-visible::after { transform: scaleX(1); }
#btnDevam { color: #ffe39a; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .giris-icerik { left: 8vw; right: auto; top: 0; bottom: 0; align-content: center; justify-items: start; text-align: left; padding: 0; }
  .giris-sahne::after { background: linear-gradient(90deg, rgba(20, 22, 50, .78), rgba(20, 22, 50, .3) 45%, rgba(20, 22, 50, 0) 70%); }
  .giris-menu { justify-items: start; }
  .giris-menu .el { padding-left: 0; }
  .giris-menu .el::after { left: 0; }
}

/* ---------- Sahne ---------- */
.sahne { position: absolute; left: 0; right: 0; top: 0; height: 46%; overflow: hidden; background: #1a2440; }
.sahne > div { position: absolute; inset: 0; transition: opacity .7s ease; }
.sahne > div.giden { opacity: 0; }
.sahne svg { width: 100%; height: 100%; display: block; }
.sahne .bulutlar { animation: suzul 90s linear infinite alternate; }
.sahne .yagmur { animation: yagis .5s linear infinite; }
@keyframes suzul { to { transform: translateX(60px); } }
@keyframes yagis { from { transform: translate(0, -40px); } to { transform: translate(-6px, 0); } }

/* ---------- Defter sayfası ---------- */
.sayfa {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(46% - 14px);
  background-color: var(--kagit);
  background-image: linear-gradient(90deg, transparent 46px, var(--kenar) 46px, var(--kenar) 47.5px, transparent 47.5px);
  clip-path: polygon(0 10px, 4% 4px, 9% 11px, 15% 3px, 21% 9px, 27% 2px, 34% 10px, 40% 4px, 46% 11px, 53% 3px, 59% 9px, 66% 2px, 72% 10px, 78% 4px, 85% 11px, 91% 3px, 96% 9px, 100% 4px, 100% 100%, 0 100%);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.kaydir {
  position: absolute; inset: 3.4rem 0 0 0;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: .2rem 20px calc(64px + var(--safe-alt)) 62px;
  background-image: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--satir) - 1px), var(--cizgi) calc(var(--satir) - 1px), var(--cizgi) var(--satir));
  background-position: 0 calc(.2rem + 3px);
  background-attachment: local;
}
.kaydir::-webkit-scrollbar { display: none; }
.sayfa-ust { position: absolute; top: 12px; left: 8px; right: 14px; display: flex; align-items: center; gap: 2px; z-index: 2; }
.ikon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--soluk); }
.ikon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ikon-btn:hover { color: var(--murekkep); background: rgba(34, 48, 122, .06); }
.tarih { margin-left: auto; font-family: var(--el); font-size: 1.35rem; color: var(--murekkep); opacity: .85; }

.metin { min-height: 2rem; }
.satir { margin: 0; line-height: var(--satir); transition: opacity .4s; }
.satir { text-indent: 1.1em; }
.satir.sen, .satir.bolum-ayrac { text-indent: 0; }
.satir.eski { opacity: .42; }
.satir.anlati { color: var(--kursun); }
.satir.konusma { color: var(--murekkep); }
.satir .kim { font-family: var(--el); font-weight: 700; font-size: 1.35em; line-height: 1; margin-right: .35em; }
.satir.sen { font-family: var(--el); font-size: 1.4em; color: var(--murekkep); line-height: var(--satir); }
.satir.sen::before { content: '✓ '; color: var(--kenar); }
.satir.bolum-ayrac { font-family: var(--el); color: var(--soluk); font-size: 1.25em; text-align: center; letter-spacing: .2em; }

.ilerle { position: absolute; right: 18px; bottom: calc(14px + var(--safe-alt)); z-index: 2; font-family: var(--el); font-size: 1.25rem; color: var(--soluk); opacity: 0; transition: opacity .3s; pointer-events: none; }
.ilerle::after { content: ' ›'; }
.sayfa.bekliyor .ilerle { opacity: .8; }
.sayfa.yaziyor .ilerle { opacity: 0; }

/* Portre: bantla yapıştırılmış vesikalık, sahne ile sayfanın arasında */
.portre { position: absolute; z-index: 4; top: calc(46% - 96px); right: 118px; width: 76px; transform: rotate(3deg); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); pointer-events: none; animation: portreGel .3s ease-out; }
@keyframes portreGel { from { opacity: 0; transform: translateY(6px) rotate(3deg); } }
.portre-foto { background: #fff; padding: 4px 4px 12px; }
.portre-foto svg { display: block; width: 100%; height: auto; }
.bant { position: absolute; top: -9px; left: 50%; width: 46px; height: 16px; margin-left: -23px; background: rgba(240, 228, 190, .8); transform: rotate(-6deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Seçimler: defter maddesi + tükenmezle kutucuk */
.secimler { display: grid; gap: 4px; margin-top: calc(var(--satir) * .6); }
.secim { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; text-align: left; font-family: var(--el); font-size: 1.45rem; line-height: 1.15; color: var(--murekkep); padding: 6px 4px; border-radius: 6px; opacity: 0; transform: translateY(4px); animation: belir .35s forwards; }
.secim:nth-child(2) { animation-delay: .08s; } .secim:nth-child(3) { animation-delay: .16s; } .secim:nth-child(4) { animation-delay: .24s; }
@keyframes belir { to { opacity: 1; transform: none; } }
.secim:hover, .secim:focus-visible { background: rgba(34, 48, 122, .06); }
.secim svg { width: 26px; height: 26px; margin-top: 2px; fill: none; stroke: var(--murekkep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.secim .tik { stroke: var(--kenar); stroke-width: 3; stroke-dasharray: 30; stroke-dashoffset: 30; }
.secim.secildi .tik { transition: stroke-dashoffset .35s ease-out; stroke-dashoffset: 0; }
.secimler.bitti .secim:not(.secildi) { opacity: .25; transition: opacity .3s; }

/* Notlar: köşeye iliştirilmiş küçük kağıt */
.notlar { position: absolute; left: 50%; top: calc(46% - 64px); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; z-index: 5; width: max-content; max-width: 92vw; }
.not { background: var(--sari-not); color: #4a3a12; font-family: var(--el); font-size: 1.3rem; padding: 6px 16px 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transform: rotate(-1.5deg); animation: notGel .4s ease-out, notGit .4s ease-in 3.2s forwards; display: flex; gap: 8px; align-items: center; }
.not.ani { background: #fff; color: #2a2a2a; }
.not svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@keyframes notGel { from { opacity: 0; transform: translateY(-10px) rotate(-1.5deg); } }
@keyframes notGit { to { opacity: 0; transform: translateY(-8px) rotate(-1.5deg); } }

/* Masaüstü: sahne tam ekran, defter sağda bir sayfa */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .sahne { height: 100%; }
  .sayfa { top: 28px; bottom: 28px; right: 32px; left: auto; width: min(480px, 40vw); clip-path: none; transform: rotate(.5deg); box-shadow: 0 20px 50px rgba(10, 10, 30, .45), 0 2px 0 var(--kagit-golge); border-radius: 2px; }
  .notlar { left: calc(100% - min(480px, 40vw) / 2 - 32px); top: 42px; }
  .portre { width: 96px; top: 70px; right: calc(32px + min(480px, 40vw) - 30px); transform: rotate(-4deg); }
  @keyframes portreGel { from { opacity: 0; transform: translateY(6px) rotate(-4deg); } }
}

/* ---------- Katmanlar ---------- */
.katman { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(12, 16, 36, .62); padding: 20px; }
.katman.koyu { background: rgba(8, 10, 24, .86); }
#panel { z-index: 30; }

/* Saatli Maarif takvimi yaprağı */
.takvim { width: min(320px, 86vw); background: #fbfaf4; color: #1b1b1b; text-align: center; padding: 22px 22px 18px; position: relative; box-shadow: 0 30px 60px rgba(0, 0, 0, .45); background-image: linear-gradient(180deg, rgba(0, 0, 0, .03), transparent 30%); }
.takvim-delik { position: absolute; top: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 120px; }
.takvim-delik i { width: 10px; height: 10px; border-radius: 50%; background: #1b1d33; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.takvim-ust { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--takvim-kirmizi); padding: 8px 2px 6px; color: var(--takvim-kirmizi); font-weight: 700; font-size: 1.15rem; }
.takvim-gun { font-size: clamp(7rem, 34vw, 9.5rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; margin: 8px 0 0; font-variant-numeric: lining-nums; }
.takvim-gun.kirmizi { color: var(--takvim-kirmizi); }
.takvim-haftagunu { font-size: 1.15rem; font-weight: 600; letter-spacing: .04em; margin-bottom: 14px; }
.takvim-alt { border-top: 1px solid #c9c6b8; padding-top: 12px; }
.takvim-bolum { font-size: .82rem; color: #666; }
.takvim-ad { font-family: var(--el); font-weight: 700; font-size: 2.1rem; line-height: 1.05; margin: 2px 0 6px; color: var(--murekkep); }
.takvim-soz { font-style: italic; font-size: .92rem; color: #444; margin: 0 0 14px; }
.takvim-btn { font-size: 1.4rem; color: var(--takvim-kirmizi); padding: 6px 14px; }
.takvim.kopuyor { animation: kop .8s cubic-bezier(.5, 0, .9, .5) forwards; transform-origin: 20% 0; }
@keyframes kop { 30% { transform: rotate(-6deg) translateY(4px); } 100% { transform: rotate(-24deg) translate(-40px, 110vh); opacity: .9; } }
.takvim.geliyor { animation: tkGel .5s ease-out; }
@keyframes tkGel { from { opacity: 0; transform: translateY(-20px); } }

/* Defter etiketi */
.etiket { width: min(340px, 90vw); background: #fdfdf8; border-radius: 14px; border: 2px solid #2b5aa8; box-shadow: 0 0 0 6px #fdfdf8, 0 0 0 8px #2b5aa8, 0 30px 60px rgba(0, 0, 0, .4); padding: 18px 22px 16px; display: grid; gap: 10px; }
.etiket-baslik { text-align: center; color: #2b5aa8; font-weight: 800; letter-spacing: .12em; font-size: .95rem; margin-bottom: 4px; }
.etiket label { display: grid; grid-template-columns: 72px 1fr; align-items: end; color: #2b5aa8; font-weight: 600; font-size: .95rem; border-bottom: 1.5px dotted #2b5aa8; padding-bottom: 2px; }
.etiket input, .etiket span { font-family: var(--el); font-size: 1.7rem; color: var(--murekkep); border: 0; background: transparent; padding: 0; outline: none; width: 100%; line-height: 1.1; }
.etiket input::placeholder { color: #9aa8c8; }
.etiket button { justify-self: end; font-size: 1.5rem; color: var(--murekkep); margin-top: 6px; padding: 4px 12px; }

/* Paneller */
.panel { width: min(760px, 100%); max-height: min(86vh, 900px); display: grid; grid-template-rows: auto 1fr; background: var(--kagit); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); border-radius: 3px; overflow: hidden; }
.panel-ust { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 22px; }
.panel-ust h2 { margin: 0; font-family: var(--el); font-size: 2rem; color: var(--murekkep); }
.panel-icerik { overflow-y: auto; padding: 4px 22px 24px; }
.panel-not { color: var(--soluk); margin: 0 0 14px; font-size: .92rem; }

.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.foto { background: #fff; padding: 6px 6px 30px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); position: relative; }
.foto:nth-child(3n) { transform: rotate(1.4deg); } .foto:nth-child(3n+1) { transform: rotate(-1deg); }
.foto .kare { aspect-ratio: 4/3; overflow: hidden; position: relative; background: #ddd; }
.foto .kare svg { width: 100%; height: 100%; display: block; }
.foto .damga { position: absolute; right: 8px; bottom: 6px; color: #ff8a2a; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-shadow: 0 0 4px rgba(255, 120, 30, .8); }
.foto .alt { position: absolute; left: 8px; right: 8px; bottom: 5px; font-family: var(--el); font-size: 1.15rem; color: var(--murekkep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foto.kilitli .kare { background: repeating-linear-gradient(45deg, #e9e7de, #e9e7de 8px, #e2e0d6 8px, #e2e0d6 16px); display: grid; place-items: center; font-family: var(--el); font-size: 2.4rem; color: #b3b0a3; }
.foto.kilitli .alt { color: #b3b0a3; }
.foto button { all: unset; cursor: pointer; display: block; }
.foto-buyuk { display: grid; gap: 10px; }
.foto-buyuk .foto { transform: none; padding-bottom: 12px; }
.foto-buyuk h3 { font-family: var(--el); font-size: 1.8rem; color: var(--murekkep); margin: 4px 0 0; }
.foto-buyuk p { margin: 0; color: var(--kursun); font-style: italic; }

.sonlar { list-style: none; margin: 0; padding: 0; }
.sonlar li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--cizgi); }
.sonlar .kutu { width: 26px; height: 26px; border: 2px solid var(--murekkep); border-radius: 3px; display: grid; place-items: center; color: var(--kenar); font-weight: 900; }
.sonlar b { font-family: var(--el); font-size: 1.6rem; color: var(--murekkep); font-weight: 700; display: block; line-height: 1.1; }
.sonlar span { color: var(--soluk); font-style: italic; font-size: .92rem; }
.sonlar li.kilitli b { color: #9a98a8; }

.ayar { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--cizgi); }
.ayar > span { font-weight: 600; }
.ayar-secenek { display: flex; flex-wrap: wrap; gap: 8px; }
.ayar-secenek button { font-family: var(--el); font-size: 1.35rem; padding: 2px 12px; border-radius: 20px; border: 1.5px solid var(--cizgi); color: var(--murekkep); }
.ayar-secenek button[aria-pressed="true"] { border-color: var(--murekkep); background: var(--murekkep); color: var(--kagit); }

.menu-liste { display: grid; gap: 2px; justify-items: start; }
.menu-liste button { font-family: var(--el); font-size: 1.8rem; color: var(--murekkep); padding: 4px 6px; }
.menu-liste button.tehlike { color: var(--kenar); }
.gecmis p { margin: 0 0 10px; line-height: 1.55; }
.gecmis .kim { font-family: var(--el); font-weight: 700; font-size: 1.3em; color: var(--murekkep); }
.gecmis .sen { font-family: var(--el); font-size: 1.3em; color: var(--kenar); }

/* Son kartı */
.son-kart { text-align: center; color: #f4ecdc; max-width: 520px; display: grid; justify-items: center; gap: 6px; animation: tkGel 1.2s ease-out; }
.son-ust { font-family: var(--el); font-size: 1.6rem; color: #f2b48a; }
.son-kart h2 { font-family: var(--el); font-size: clamp(3rem, 12vw, 4.6rem); margin: 0; line-height: 1; font-weight: 700; }
.son-kart p { font-style: italic; color: #d8cfc0; margin: 6px 0 14px; line-height: 1.6; }
.son-kunye { font-size: .82rem; color: #9a96a8; margin-bottom: 18px; }
.son-btnlar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.son-btnlar .el { font-size: 1.6rem; color: #fff1d8; }

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