:root {
  --canvas: #e8e5df;
  --dot: #c4bfb6;
  --frame: #fbfaf8;
  --fg: #151515;
  --muted: #7a766f;
  --line: #dcd7cf;
  --panel: rgba(251, 250, 248, .86);
  --accent: #ff4f2b;
  --sticky: #ffe36e;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --canvas: #161616;
  --dot: #2e2e2e;
  --frame: #212120;
  --fg: #f0ece5;
  --muted: #8f8a82;
  --line: #34332f;
  --panel: rgba(33, 33, 32, .86);
  --sticky: #f2d45c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--canvas); color: var(--fg);
  font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

/* ---------- TUVAL ---------- */
.viewport {
  position: fixed; inset: 0; overflow: hidden; cursor: grab; touch-action: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px);
}
.viewport.grabbing { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

/* ---------- FRAME ---------- */
.frame { position: absolute; background: var(--frame); border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px -12px rgba(0,0,0,.12); }
.frame__label {
  position: absolute; left: 0; bottom: 100%; padding-bottom: 10px;
  font-size: 20px; color: var(--muted); white-space: nowrap; pointer-events: none;
}
.frame__label::before { content: "#"; margin-right: 8px; opacity: .6; }
.frame__size {
  position: absolute; top: 100%; left: 50%; margin-top: 12px; transform: translateX(-50%);
  background: var(--accent); color: #fff; font: 500 16px var(--mono);
  padding: 3px 10px; border-radius: 4px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.frame::after {
  content: ""; position: absolute; inset: -3px; border: 3px solid var(--accent); border-radius: 6px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.frame:hover::after { opacity: .45; }
.frame.selected::after, .frame:focus-visible::after { opacity: 1; }
.frame.selected .frame__size, .frame:hover .frame__size { opacity: 1; }
.frame.selected .frame__label, .frame:hover .frame__label { color: var(--accent); }
.frame:focus { outline: none; }

/* Seçim tutamaçları */
.handles i { position: absolute; width: 14px; height: 14px; background: #fff; border: 3px solid var(--accent); }
.handles .tl { left: -8px; top: -8px; } .handles .tr { right: -8px; top: -8px; }
.handles .bl { left: -8px; bottom: -8px; } .handles .br { right: -8px; bottom: -8px; }

.mono { font-family: var(--mono); font-size: 18px; color: var(--muted); letter-spacing: .02em; }
.eyebrow { font: 500 16px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 24px; }

/* HERO */
.hero { padding: 64px 72px 72px; }
.hero__meta { display: flex; justify-content: space-between; gap: 24px; }
.hero__title {
  font-family: var(--serif); font-weight: 400; font-size: 300px; line-height: .86; letter-spacing: -.035em;
  margin: 56px 0 64px;
}
.hero__title span { display: block; }
.hero__title .sel { position: relative; display: inline-block; font-style: italic; color: var(--accent); margin-left: 120px; padding: 0 16px; }
.hero__title .sel::before { content: ""; position: absolute; inset: 6px 0 -10px; border: 3px solid var(--accent); pointer-events: none; }
.hero__title .sel .handles i { z-index: 1; }
.hero__title .sel .handles .tl, .hero__title .sel .handles .tr { top: -2px; }
.hero__title .sel .handles .bl, .hero__title .sel .handles .br { bottom: -18px; }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; border-top: 2px solid var(--line); padding-top: 32px; }
.hero__tagline { font-size: 34px; line-height: 1.25; max-width: 680px; }

/* STICKY NOT */
.sticky {
  position: absolute; width: 280px; padding: 28px 28px 32px; background: var(--sticky); color: #2a2410;
  font-size: 22px; line-height: 1.35; box-shadow: 0 18px 30px -14px rgba(0,0,0,.35);
  border-radius: 2px 2px 18px 2px;
}
.sticky small { display: block; margin-top: 14px; font: 500 15px var(--mono); opacity: .6; }
.sticky--pink { background: #ffb3c7; }
.sticky--blue { background: #a9d4ff; }

/* İŞ KARTI */
.work { padding: 20px; cursor: pointer; }
.work__media { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 2px; background: var(--line); }
.work__media img, .placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.work:hover .work__media img, .work:hover .placeholder { transform: scale(1.04); }
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 32px;
  font-family: var(--serif); font-size: 96px; line-height: 1; color: rgba(255,255,255,.94);
}
.work__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 22px 4px 4px; }
.work__title { font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; }

/* BİLEŞENLER */
.components, .about { padding: 48px; }
.pills { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.pills:last-child { margin-bottom: 0; }
.pills li { border: 2px solid var(--line); border-radius: 999px; padding: 10px 22px; font-size: 22px; }
.pills--accent li { border-color: var(--fg); background: var(--fg); color: var(--frame); }
.about p { font-size: 28px; line-height: 1.35; margin-bottom: 24px; }
.about p:first-of-type { font-family: var(--serif); font-size: 46px; line-height: 1.08; }
.about p:last-child { margin-bottom: 0; }

/* CV */
.cv { padding: 64px 72px 72px; }
.cv__head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 56px; }
.cv__title { font-family: var(--serif); font-weight: 400; font-size: 140px; line-height: .9; letter-spacing: -.02em; }
.cv__title em { color: var(--accent); }
.cv__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 72px; }
.cv__col > * + .eyebrow { margin-top: 56px; }
.tl li { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 24px 0; border-top: 2px solid var(--line); }
.tl li:last-child { border-bottom: 2px solid var(--line); }
.tl .title { font-size: 26px; font-weight: 500; }
.tl .place { font-size: 22px; color: var(--muted); }
.tl .text { font-size: 21px; margin-top: 8px; }
.btn-lg {
  display: inline-flex; align-items: center; gap: 10px; font-size: 22px; padding: 16px 30px;
  border: 2px solid var(--fg); border-radius: 999px; transition: .2s;
}
.btn-lg:hover { background: var(--fg); color: var(--frame); }

/* İLETİŞİM */
.contact { padding: 72px; background: var(--fg); color: var(--frame); }
.contact .eyebrow { color: inherit; opacity: .6; }
.contact__mail {
  display: block; font-family: var(--serif); font-size: 132px; line-height: 1; letter-spacing: -.02em;
  overflow-wrap: anywhere; transition: color .25s;
}
.contact__mail:hover { color: var(--accent); font-style: italic; }
.contact__social { display: flex; flex-wrap: wrap; gap: 16px 40px; margin-top: 72px; padding-top: 32px; border-top: 2px solid rgba(127,127,127,.35); font-size: 24px; }
.contact__social a:hover { color: var(--accent); }

/* ---------- ARAYÜZ (UI) ---------- */
.topbar {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 20; pointer-events: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.topbar > * { pointer-events: auto; }
.file, .topbar__right, .toolbar, .panel, .hint {
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px -12px rgba(0,0,0,.2);
}
.file { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 14px; }
.file__icon { color: var(--accent); }
.file__name { font-weight: 600; }
.file__sep, .file__doc { color: var(--muted); }
.topbar__right { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 14px; font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; animation: pulse 2s infinite; }
.status.off::before { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,204,113,.6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(46,204,113,0); } }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.icon-btn:hover, .toolbar button:hover, .layers button:hover { background: rgba(127,127,127,.14); }
.btn { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.btn--accent { background: var(--accent); color: #fff; }

.panel { position: fixed; z-index: 15; }
.panel__title { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.layers { top: 68px; left: 12px; width: 220px; padding: 14px 8px; max-height: calc(100svh - 160px); overflow: auto; }
.layers .panel__title { padding: 0 8px 10px; }
.layers button { display: flex; width: 100%; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; text-align: left; }
.layers button::before { content: "#"; color: var(--muted); }
.layers .sub button { padding-left: 26px; }
.layers .sub button::before { content: "▢"; font-size: 11px; line-height: 20px; }
.layers button.active { background: var(--accent); color: #fff; }
.layers button.active::before { color: inherit; }

.inspector {
  top: 68px; right: 12px; bottom: 12px; width: 380px; display: flex; flex-direction: column;
  transform: translateX(calc(100% + 24px)); transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.inspector.open { transform: none; }
.inspector__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.inspector__body { padding: 20px 18px 24px; overflow: auto; }
.inspector h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin-bottom: 18px; }
.props { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; padding: 14px 0; border-block: 1px solid var(--line); margin-bottom: 18px; }
.props dt { color: var(--muted); }
.inspector p { font-size: 15px; line-height: 1.6; }
.inspector .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.inspector .tags li { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.inspector .gallery { display: grid; gap: 10px; margin-top: 18px; }
.inspector .gallery img { border-radius: 6px; }
.inspector__nav { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.inspector__nav button { font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.inspector__nav button:hover { background: rgba(127,127,127,.14); }

.toolbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; gap: 4px; padding: 5px; max-width: calc(100vw - 24px);
}
.toolbar__group { display: flex; align-items: center; gap: 2px; }
.toolbar__group + .toolbar__group { border-left: 1px solid var(--line); padding-left: 4px; }
.toolbar button { padding: 8px 12px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.toolbar button.active { background: var(--fg); color: var(--frame); }
.zoom { font: 500 12px var(--mono); min-width: 46px; text-align: center; color: var(--muted); }

.hint {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 20;
  padding: 8px 14px; font-size: 13px; white-space: nowrap; transition: opacity .5s, transform .5s;
}
.hint.gone { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }

/* Gezen imleç */
.ghost { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; color: var(--accent); will-change: transform; }
.ghost svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.ghost__tag {
  position: absolute; left: 16px; top: 18px; background: var(--accent); color: #fff; white-space: nowrap;
  font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 4px 10px 10px 10px;
}

@media (max-width: 1000px) { .layers { display: none; } }
@media (max-width: 720px) {
  .file__doc, .file__sep, .status { display: none; }
  .toolbar { left: 12px; right: 12px; transform: none; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar__nav button { padding: 8px 10px; }
  .inspector { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62svh; transform: translateY(calc(100% + 24px)); z-index: 25; }
  .hint { bottom: 72px; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ghost { display: none; }
}
