/* portfolyo-2026 — atlas anasayfa
 * Codex'in portfolio-runtime/demo.css'inden portlandı.
 * İki görünüm: küre (.globe, globe.js; her proje kürede düz bir kart) ve
 * düz duvar (kartlar kendini dizen dinamik bir ızgarada). Bütün projeler
 * projects.js'ten, kartları atlas.js üretir. Görüntüleyici viewer.css'te. */

/* Deskspace sayfasına geçiş: tarayıcı destekliyorsa yumuşak çapraz geçiş */
@view-transition { navigation: auto; }

* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --ink: #111310;
  --paper: #eeeae2;
  --muted: #b1b4a9;
  --accent: #d5f57a;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Instrument Sans", system-ui, sans-serif;
  overflow: hidden;
}

button, a, input { touch-action: manipulation; }
button, a { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; padding: 12px 16px; }
button:hover { color: var(--accent); }
button:disabled { opacity: 0.35; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--ink); }
[hidden] { display: none !important; }

header, footer {
  position: fixed; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px; background: var(--ink);
}
header { top: 0; height: 100px; }
footer { bottom: 0; height: 82px; }

.identity { text-decoration: none; font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.identity span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 5px; }
/* wordmark (2026-09-26), same as the home page */
.identity { display: inline-flex; align-items: baseline; gap: 10px; }
.identity .wordmark { margin: 0; font: 400 21px/1 "Climate Crisis", sans-serif; font-variation-settings: "YEAR" 1979; letter-spacing: -0.01em; color: var(--paper, #eeeae2); }
.identity .studio { margin: 0; font: 500 10px/1 "Instrument Sans", sans-serif; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.study, footer p { font-size: 12px; color: var(--muted); }
.header-actions { display: flex; gap: 10px; }
header button, header .pill { font-size: 12px; border: 1px solid #3c4235; border-radius: 30px; padding: 10px 18px; }
header .pill { text-decoration: none; }
header .pill:hover { color: var(--accent); }

footer p { flex: 1 1 0; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#open-index { font-size: 13px; border: 1px solid #3c4235; border-radius: 30px; padding: 10px 22px; }
#open-index span { color: var(--muted); margin-left: 8px; }
.zoom { flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 5px; }
.zoom output { font-size: 11px; min-width: 42px; text-align: center; }
.zoom button { font-size: 21px; }

/* ---------- düz duvar ----------
   2026-09-24: sabit hücreli ızgara (2x2, 3x2, 2x3) görseli hücreye `cover`
   ile sığdırıyor, birçok kartı kırpıyordu. Şimdi hizalı satırlar: her
   satırdaki kartlar aynı yükseklikte, her kartın genişliği kendi görselinin
   oranından (atlas.js layoutFlat). Çerçeve görsele uyar; kırpma yok. */

#atlas { position: absolute; inset: 100px 0 82px; overflow: hidden; cursor: grab; touch-action: none; }
#atlas.dragging { cursor: grabbing; }
#world { position: absolute; transform-origin: 0 0; will-change: transform; }

.project {
  position: relative; padding: 0; text-align: left; overflow: hidden;
  background: #282b26; box-shadow: 0 22px 55px #0004;
  cursor: pointer; transition: filter 0.25s, box-shadow 0.3s;
}
.project img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  pointer-events: none; transition: opacity 0.5s;
}
/* ikinci kare üstüne gelince yumuşakça gelir; yalnız oranı kartla aynıysa
   (atlas.js): değilse ya kırpılır ya bant bırakırdı */
.project .alt { opacity: 0; }
/* filmi olan kart: üstüne gelince orijinal film oynar (atlas.js), kartla aynı oranda */
.project video.alt {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  pointer-events: none; transition: opacity 0.4s;
}
.project:hover .alt.ready, .project:focus-visible .alt.ready { opacity: 1; }
.project:hover { box-shadow: 0 30px 70px #0008; filter: brightness(1.06); }
.project::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #000a); pointer-events: none; }

.project-name {
  position: absolute; bottom: 16px; left: 18px; right: 18px; z-index: 1;
  font-family: "Barlow Condensed", "Instrument Sans", sans-serif;
  font-size: 26px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.05; color: #fff;
}
.project-name small {
  display: block; font-family: "Instrument Sans", sans-serif;
  font-size: 13px; letter-spacing: 0; font-weight: 400; margin-top: 8px;
}
.project.big .project-name, .project.wide .project-name, .project.tall .project-name { left: 30px; right: auto; bottom: 30px; font-size: 46px; }
.project.big .project-name small, .project.wide .project-name small, .project.tall .project-name small { font-size: 15px; margin-top: 12px; }
/* öne çıkanlar (en çok renderlı sayfalar) iki kat yüksek satırda: ad da büyük */
.project.feature .project-name { left: 44px; bottom: 44px; font-size: 84px; }
.project.feature .project-name small { font-size: 22px; margin-top: 16px; }
.project.feature .enter { right: 44px; bottom: 50px; font-size: 18px; }
/* sonsuz duvarın kopyaları yalnız düz görünümde */
.globe .project.copy { display: none; }
/* Logo proje adının yerini alır; yüksekliği em ile verilir ki yazıyla
   aynı optik ağırlıkta kalsın. */
.logo.has-logo { display: block; }
.logo.has-logo svg { display: block; height: 0.54em; width: auto; }
/* Amblem (AnZa) adın yerini almaz, önüne gelir: tek başına adı söylemiyor */
.logo.has-mark svg { display: inline-block; height: 0.8em; width: auto; margin-right: 0.2em; vertical-align: -0.1em; }
.enter { position: absolute; right: 28px; bottom: 32px; z-index: 1; font-size: 13px; color: var(--accent); transition: transform 0.3s; }
.project:not(.big):not(.wide):not(.tall) .enter { display: none; }
.project:hover .enter { transform: translateX(-8px); }

/* ---------- küre (globe.js) ----------
   Dünya atlasın ortasında sıfır boyutlu bir eksen; her kart küreye teğet,
   düz bir levha. Görseller hiç bükülmez. Yazılar kartta değil, alttaki
   yazı alanında (#caption). Öndeki ve üstüne gelinen kart biraz öne
   çıkar ve aydınlanır; yanlar vinyetle kararır. */
.globe #atlas { perspective: 1300px; perspective-origin: 50% 50%; }
.globe #atlas.spinning { cursor: grabbing; }
.globe #atlas::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 72% at 50% 50%, transparent 55%, var(--ink) 100%);
}
.globe #world { display: block; left: 50%; top: 50%; width: 0; height: 0; padding: 0; transform-style: preserve-3d; }
.globe .project {
  position: absolute; backface-visibility: hidden; box-shadow: none; background: #1d201b;
  filter: brightness(0.78);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s;
}
.globe .project:hover, .globe .project.is-front, .globe .project:focus-visible { filter: none; --lift: 45px; }
.globe .project::after, .globe .project-name, .globe .enter { display: none; }
.globe .project:hover img { transform: none; }
.globe .project:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }

/* dar ekranda kürenin üstüne binebilir: gölge yazıyı görselden ayırır */
#caption { display: none; position: absolute; left: 34px; bottom: 28px; z-index: 3; max-width: min(360px, 34vw); pointer-events: none; text-shadow: 0 2px 16px #000c, 0 0 2px #0008; }
.globe #caption { display: block; }
#caption .cap-cat { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
#caption .cap-name { margin: 0; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 58px; line-height: 0.95; letter-spacing: -0.02em; }
#caption .cap-sub { margin: 12px 0 0; font-size: 15px; }
#caption .cap-open { pointer-events: auto; margin-top: 10px; padding: 10px 0; font-size: 13px; color: var(--accent); }
#caption .cap-open:hover { color: var(--paper); }

/* ---------- index ---------- */

#index .index-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 34px; height: 104px; border-bottom: 1px solid #30352b; }
#index h2 { font-family: "Barlow Condensed", sans-serif; font-size: 38px; letter-spacing: -0.02em; font-weight: 600; margin: 0; }
#index h2 span { font-family: "Instrument Sans", sans-serif; font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 14px; letter-spacing: 0; }
#index h2 span i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 0 8px 0 18px; vertical-align: 0.1em; }
#index .index-head button { font-size: 13px; }
#index .index-head button span { font-size: 25px; margin-left: 22px; }
/* liste kendi yüksekliğinde akar, gövde kayar; önizleme yerinde durur */
.index-body { display: grid; grid-template-columns: minmax(0, 1fr) min(34vw, 540px); align-items: start; gap: 48px; padding: 34px; height: calc(100dvh - 104px); overflow: auto; }
#index-list { columns: 3 220px; column-gap: 44px; padding-bottom: 20px; }
#index-list section { break-inside: avoid; margin-bottom: 24px; }
#index-list h3 { margin: 0 0 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
#index-list ul { list-style: none; margin: 0; padding: 0; }
#index-list li button {
  padding: 2px 0; text-align: left;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15;
}
/* kendi sayfası olan (etkileşimli) proje: yeşil nokta */
#index-list li button.live::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 10px; vertical-align: 0.3em; }
.index-preview { position: sticky; top: 0; margin: 0; aspect-ratio: 202 / 158; background: #1d201b; overflow: hidden; }
.index-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- proje görünümü ---------- */

dialog {
  position: fixed; inset: 0; width: 100%; height: 100%;
  max-width: none; max-height: none; border: 0; padding: 0;
  background: #111310; color: var(--paper); overflow: auto;
}
dialog::backdrop { background: #111310; }
dialog[open] { animation: enter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes enter { from { opacity: 0.5; clip-path: inset(9%); } to { opacity: 1; clip-path: inset(0); } }

.project-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 34px; border-bottom: 1px solid #30352b; height: 104px; }
h1 { font-family: "Barlow Condensed", sans-serif; font-size: 38px; letter-spacing: -0.02em; font-weight: 600; margin: 0; }
.project-header button { font-size: 13px; }
.project-header button span { font-size: 25px; margin-left: 22px; }

.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 42px; padding: 32px; height: calc(100dvh - 104px); }
#visual { min-width: 0; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #191c17; }
#gallery-image { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; -webkit-user-drag: none; user-select: none; }
#visual.lens-active #gallery-image { cursor: crosshair; }

aside { align-self: center; padding-right: 16px; }
aside > p { font-size: 24px; line-height: 1.25; letter-spacing: -0.025em; }
.gallery-controls { display: flex; align-items: center; justify-content: space-between; margin: 30px 0; font-size: 13px; border-block: 1px solid #3c4235; }
.primary { background: var(--accent); color: var(--ink); border-radius: 30px; width: 100%; font-weight: 600; }
.primary:hover { background: #e3ffa6; color: #111; }
aside h2 { font-size: 22px; font-weight: 500; margin: 28px 0 10px; }
#game-instructions { font-size: 14px; line-height: 1.6; color: var(--muted); }
#game-status { font-size: 17px; color: var(--accent); min-height: 25px; }
.game-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.game-actions button { border: 1px solid #555d4b; border-radius: 30px; font-size: 12px; padding: 9px 13px; }
.small-note, .honest { font-size: 11px !important; line-height: 1.5 !important; color: var(--muted); margin-top: 35px; }

#game-board { display: grid; gap: 4px; max-width: 100%; max-height: 100%; }
.puzzle { grid-template-columns: repeat(3, 1fr); width: min(100%, calc((100dvh - 175px) * 0.8)); aspect-ratio: 4 / 5; }
.tile { background-size: 300% 300%; position: relative; border: 2px solid transparent; padding: 0; min-height: 0; }
.tile.selected { border-color: var(--accent); }
.tile span { position: absolute; left: 8px; bottom: 8px; background: #111c; color: #fff; padding: 4px 7px; border-radius: 3px; font-size: 12px; }
.memory { width: 100%; height: min(100%, 600px); grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 12px !important; }
.memory-card { position: relative; background: #262c21; border: 1px solid #424b38; overflow: hidden; border-radius: 2px; font-size: 25px; min-height: 130px; }
.memory-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.memory-card.matched { border: 2px solid var(--accent); }
.memory-card:disabled { opacity: 1; }

#focus-controls label { font-size: 13px; }
input[type="range"] { accent-color: var(--accent); width: 100%; margin-top: 20px; }
#lens { position: absolute; width: 210px; height: 210px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 8px 40px #0008; pointer-events: none; background-repeat: no-repeat; z-index: 2; }
#visual.lens-active { touch-action: none; cursor: crosshair; }
#visual.reference #game-board { display: none; }
#visual.reference #gallery-image { display: block !important; }

/* ---------- peek ---------- */

.detail-peek { position: fixed; inset: 0; z-index: 20; background: #111310f5; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.detail-peek img { width: 100%; height: 100dvh; object-fit: contain; transform: scale(1.2); animation: peek-in 0.25s ease-out; }
@keyframes peek-in { from { opacity: 0; transform: scale(1); } to { opacity: 1; transform: scale(1.2); } }
.peeking header, .peeking footer, .peeking #caption { visibility: hidden; }

html:active-view-transition dialog[open] { animation: none; }
::view-transition-group(project-photo) { animation-duration: 460ms; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(project-photo), ::view-transition-new(project-photo) { height: 100%; object-fit: contain; }

/* ---------- dar ekran ---------- */

@media (min-width: 701px) and (max-width: 1000px) {
  footer p { display: none; }
  .zoom { flex: 0 0 auto; }
  #caption .cap-name { font-size: 44px; }
}

@media (max-width: 700px) {
  .project.copy { display: none; }
  .project.feature .project-name { font-size: 40px; left: 20px; bottom: 20px; }
  .project.feature .project-name small { font-size: 13px; }
  header { height: 82px; padding: 14px 18px; }
  .study, #view-mode { display: none; }
  .identity { font-size: 16px; }
  footer { height: 106px; padding: 10px 12px; flex-wrap: wrap; justify-content: center; gap: 0; }
  footer p { flex: 0 0 100%; text-align: center; white-space: normal; }
  .zoom { display: none; }
  #atlas { inset: 82px 0 106px; overflow-y: auto; touch-action: pan-y; }
  #world { position: relative; display: flex; flex-direction: column; gap: 18px; width: auto !important; height: auto !important; transform: none !important; padding: 12px 18px 30px; }
  /* tek sütun: kart tam genişlik, yüksekliği görselin oranından (kırpma yok) */
  .project { width: 100%; height: auto; aspect-ratio: var(--ar, 1.28); flex-shrink: 0; }
  .project .project-name, .project.big .project-name, .project.wide .project-name, .project.tall .project-name { font-size: 32px; left: 20px; bottom: 20px; }
  .project-name small { font-size: 12px; }
  .project .enter, .project:not(.big):not(.wide) .enter { display: block; right: 18px; bottom: 22px; font-size: 10px; }
  .index-body { grid-template-columns: 1fr; padding: 18px; }
  .index-preview { display: none; }
  #index .index-head { padding: 18px; height: 80px; }
  .project-header { padding: 18px; height: 80px; }
  h1 { font-size: 26px; }
  .project-header button { padding: 8px; font-size: 11px; }
  .project-header button span { margin-left: 8px; }
  .project-body { display: flex; flex-direction: column; height: auto; gap: 18px; padding: 18px; }
  #visual { height: 46dvh; min-height: 280px; flex-shrink: 0; }
  aside { width: 100%; padding: 0; }
  aside > p { font-size: 20px; margin-top: 0; }
  .gallery-controls { margin: 16px 0; }
  .small-note { margin: 18px 0; }
  .puzzle { height: 100%; width: auto; aspect-ratio: 4 / 5; }
  .memory { gap: 5px !important; }
  .memory-card { min-height: 100px; font-size: 18px; }
  #lens { width: 140px; height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*) { animation-duration: 0s; }
  .detail-peek img { animation: none; transform: none; }
}
