/* Door Hero – stiller bu bileşenle sınırlıdır, sitenin geri kalanını etkilemez */
.dh-track {
  --dh-page: #d9d4ca; --dh-ink: #1c1e22; --dh-ink-soft: #484b52;
  --dh-chip-bg: rgba(255, 255, 255, 0.78); --dh-chip-ink: #1c1e22; --dh-chip-line: rgba(28, 30, 34, 0.18); --dh-focus: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .dh-track {
    --dh-page: #1d1f22; --dh-ink: #f2efe8; --dh-ink-soft: #b9b6ae;
    --dh-chip-bg: rgba(20, 22, 25, 0.72); --dh-chip-ink: #f2efe8; --dh-chip-line: rgba(242, 239, 232, 0.22); --dh-focus: #8fb0ff;
  }
}
html[data-theme="dark"] .dh-track {
  --dh-page: #1d1f22; --dh-ink: #f2efe8; --dh-ink-soft: #b9b6ae;
  --dh-chip-bg: rgba(20, 22, 25, 0.72); --dh-chip-ink: #f2efe8; --dh-chip-line: rgba(242, 239, 232, 0.22); --dh-focus: #8fb0ff;
}
  /* ---------- Hero component (everything below is scoped to #door-hero) ---------- */
  #door-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--dh-page);
    isolation: isolate;
  }
  #door-hero canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: pan-y;           /* vertical swipes still scroll the page; horizontal drags open the door */
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  #door-hero canvas { opacity: 0; transition: opacity .6s ease; }
  #door-hero.is-ready canvas { opacity: 1; }
  #door-hero canvas.is-dragging { cursor: grabbing; }
  #door-hero canvas:focus-visible { outline: 3px solid var(--dh-focus); outline-offset: -3px; }

  #door-hero .dh-copy {
    position: absolute;
    left: clamp(20px, 6vw, 96px);
    top: clamp(18px, 4vh, 40px);
    max-width: min(30ch, 70vw);
    pointer-events: none;
    color: var(--dh-ink);
  }
  #door-hero .dh-title {
    font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(28px, 4.6vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin: 0;
  }
  #door-hero .dh-sub {
    margin: 0.9em 0 0;
    font-size: clamp(14px, 1.1vw, 17px);
    line-height: 1.5;
    color: var(--dh-ink-soft);
    display: none;
  }
  @media (min-width: 960px) {
    #door-hero .dh-copy { top: 50%; transform: translateY(-50%); }
    #door-hero .dh-sub { display: block; }
  }

  #door-hero .dh-hint {
    position: absolute;
    left: 50%;
    bottom: clamp(14px, 3vh, 28px);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--dh-chip-bg);
    color: var(--dh-chip-ink);
    border: 1px solid var(--dh-chip-line);
    font-size: 14px;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity .5s ease, transform .5s ease;
    white-space: nowrap;
  }
  #door-hero .dh-hint svg { width: 22px; height: 14px; flex: none; }
  #door-hero.has-interacted .dh-hint { opacity: 0; transform: translate(-50%, 8px); }

  #door-hero .dh-tools {
    position: absolute;
    right: clamp(12px, 2vw, 28px);
    bottom: clamp(14px, 3vh, 28px);
    display: flex;
    gap: 8px;
  }
  #door-hero .dh-chip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid var(--dh-chip-line);
    background: var(--dh-chip-bg);
    color: var(--dh-chip-ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  #door-hero .dh-chip:hover { border-color: var(--dh-chip-ink); }
  #door-hero .dh-chip:focus-visible,
  #door-hero .dh-chip:focus-within { outline: 2px solid var(--dh-focus); outline-offset: 2px; }
  #door-hero .dh-chip svg { width: 16px; height: 16px; flex: none; }
  #door-hero .dh-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
  @media (max-width: 560px) {
    #door-hero .dh-chip .dh-label-long { display: none; }
    #door-hero .dh-hint { bottom: 62px; }
  }

  #door-hero .dh-sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  #door-hero .dh-fallback {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    padding: 24px; text-align: center; color: var(--dh-ink); font-size: 16px;
  }
  #door-hero.no-webgl .dh-fallback { display: flex; }
  #door-hero.no-webgl canvas { display: none; }

  #door-hero [hidden] { display: none !important; }
  #door-hero .dh-cal {
    position: absolute; inset: 0; z-index: 10; overflow: auto;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 16px; background: rgba(10, 12, 14, 0.86); color: #f2efe8;
  }
  #door-hero .dh-cal-panel { width: min(100%, 680px); margin: auto; }
  #door-hero .dh-cal-title { margin: 0 0 4px; font-family: "Instrument Serif", Georgia, serif; font-size: clamp(22px, 3vw, 30px); }
  #door-hero .dh-cal-help { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #c9c5bc; }
  #door-hero .dh-cal-wrap { position: relative; display: inline-block; line-height: 0; max-width: 100%; user-select: none; -webkit-user-select: none; }
  #door-hero .dh-cal-wrap img { display: block; max-width: 100%; max-height: min(52vh, 480px); width: auto; height: auto; pointer-events: none; }
  #door-hero .dh-cal-box {
    position: absolute; border: 2px solid #ffcf5c; cursor: move; touch-action: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  }
  #door-hero .dh-cal-box i {
    position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #ffcf5c;
    border: 2px solid #1c1e22; border-radius: 3px; box-sizing: border-box;
  }
  #door-hero .dh-cal-box i::after { content: ""; position: absolute; inset: -9px; }
  #door-hero .dh-cal-box i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
  #door-hero .dh-cal-box i[data-h="n"]  { left: 50%; top: 0; cursor: ns-resize; }
  #door-hero .dh-cal-box i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
  #door-hero .dh-cal-box i[data-h="e"]  { left: 100%; top: 50%; cursor: ew-resize; }
  #door-hero .dh-cal-box i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
  #door-hero .dh-cal-box i[data-h="s"]  { left: 50%; top: 100%; cursor: ns-resize; }
  #door-hero .dh-cal-box i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
  #door-hero .dh-cal-box i[data-h="w"]  { left: 0; top: 50%; cursor: ew-resize; }
  #door-hero .dh-cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  #door-hero .dh-cal-btn {
    appearance: none; font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(242, 239, 232, 0.35); background: transparent; color: #f2efe8;
  }
  #door-hero .dh-cal-btn.is-primary { background: #ffcf5c; border-color: #ffcf5c; color: #1c1e22; font-weight: 600; }
  #door-hero .dh-cal-btn:focus-visible { outline: 2px solid #ffcf5c; outline-offset: 2px; }
  #door-hero .dh-cal-out { margin: 14px 0 0; font-size: 12.5px; line-height: 1.7; color: #c9c5bc; }
  #door-hero .dh-cal-out code { color: #ffe29a; word-break: break-all; }
  #door-hero .dh-cal-out .dh-cal-btn { padding: 3px 10px; font-size: 12px; }

  /* ---------- explore mode ---------- */
  #door-hero .dh-chip.is-primary { background: var(--dh-ink); color: var(--dh-page); border-color: var(--dh-ink); font-weight: 600; }
  #door-hero .dh-show-only { display: none; }
  #door-hero.is-showcase .dh-show-only { display: inline-flex; }
  #door-hero.is-showcase .dh-world-only { display: none !important; }
  #door-hero .dh-copy { transition: opacity .5s ease; }
  #door-hero.is-showcase .dh-copy, #door-hero.is-busy .dh-copy { opacity: 0; }
  #door-hero.is-busy .dh-tools { pointer-events: none; opacity: .35; }
  #door-hero.is-busy .dh-hint { opacity: 0; }
  #door-hero .dh-flash {
    position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0;
    background: radial-gradient(circle at 50% 52%, #fff 0%, rgba(255, 238, 205, .85) 30%, rgba(255, 238, 205, 0) 72%);
  }
  #door-hero .dh-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
  #door-hero .dh-tag {
    position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px 5px 8px; border-radius: 999px; background: var(--dh-chip-bg); color: var(--dh-chip-ink);
    border: 1px solid var(--dh-chip-line); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap;
    opacity: 0; transition: opacity .35s ease; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  #door-hero .dh-tags:not(.is-on) .dh-tag { pointer-events: none; }
  #door-hero .dh-tags.is-on .dh-tag { opacity: 1; }
  #door-hero .dh-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ffcf5c; border: 1.5px solid var(--dh-chip-ink); box-sizing: border-box; }
  #door-hero .dh-tag:hover { border-color: var(--dh-chip-ink); }
  #door-hero .dh-tag:focus-visible { outline: 2px solid var(--dh-focus); outline-offset: 2px; }
  #door-hero .dh-card {
    position: absolute; z-index: 6; left: clamp(12px, 2vw, 28px); bottom: clamp(64px, 10vh, 96px);
    width: min(330px, calc(100% - 24px)); padding: 14px; border-radius: 14px;
    background: var(--dh-chip-bg); color: var(--dh-chip-ink); border: 1px solid var(--dh-chip-line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  #door-hero .dh-card img { display: block; width: 100%; height: 150px; max-width: none; object-fit: contain; border-radius: 10px; margin: 0 0 10px; background: #fff; }
  #door-hero .dh-card-step { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--dh-ink); }
  @media (max-width: 560px) { #door-hero .dh-card { padding: 12px; } #door-hero .dh-card img { height: 104px; } }
  #door-hero .dh-card::after { content: ""; display: block; clear: both; }
  #door-hero .dh-card-title { margin: 0 24px 4px 0; font-family: "Instrument Serif", Georgia, serif; font-size: 22px; line-height: 1.15; }
  #door-hero .dh-card-body { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--dh-ink-soft); }
  #door-hero .dh-card-close {
    position: absolute; top: 8px; right: 10px; appearance: none; border: 0; background: transparent;
    color: var(--dh-chip-ink); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
  }
  #door-hero .dh-card-close:focus-visible { outline: 2px solid var(--dh-focus); outline-offset: 2px; }
  @media (max-width: 560px) {
    #door-hero .dh-tools { flex-wrap: wrap; justify-content: flex-end; left: 12px; }
    #door-hero .dh-card { bottom: 110px; }
  }

  /* ---------- finish: vignette, grain, motion ---------- */
  #door-hero .dh-vignette, #door-hero .dh-grain, #door-hero .dh-loader { position: absolute; pointer-events: none; }
  #door-hero .dh-vignette, #door-hero .dh-grain { inset: 0; z-index: 1; }
  #door-hero .dh-vignette { background: radial-gradient(ellipse 85% 75% at 50% 46%, transparent 50%, rgba(8, 10, 14, var(--dh-vig, .26)) 100%); }
  #door-hero .dh-grain { opacity: .09; mix-blend-mode: overlay; background-size: 160px 160px; }
  #door-hero .dh-copy, #door-hero .dh-hint, #door-hero .dh-tools { z-index: 2; }
  #door-hero .dh-loader {
    left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 3;
    border: 2px solid var(--dh-chip-line); border-top-color: var(--dh-ink); border-radius: 50%;
    animation: dhSpin .9s linear infinite; transition: opacity .4s ease;
  }
  #door-hero.is-ready .dh-loader { opacity: 0; visibility: hidden; }
  #door-hero .dh-title, #door-hero .dh-sub { opacity: 0; transform: translateY(14px); }
  #door-hero.is-ready .dh-title { animation: dhUp .9s cubic-bezier(.2, .7, .2, 1) .5s forwards; }
  #door-hero.is-ready .dh-sub { animation: dhUp .9s cubic-bezier(.2, .7, .2, 1) .75s forwards; }
  #door-hero.is-ready .dh-hint { animation: dhHint .8s ease 1.2s backwards; }
  #door-hero .dh-chip.is-primary {
    background-image: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%);
    background-size: 260% 100%; background-repeat: no-repeat; animation: dhShimmer 4s ease-in-out infinite;
  }
  #door-hero .dh-chip { transition: transform .2s ease, border-color .2s ease; }
  #door-hero .dh-chip:hover { transform: translateY(-1px); }
  #door-hero .dh-tag::before { animation: dhPulse 2.2s ease-out infinite; }
  @keyframes dhSpin { to { transform: rotate(360deg); } }
  @keyframes dhHint { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
  @keyframes dhUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes dhShimmer { 0%, 55% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
  @keyframes dhPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 207, 92, .65); } 100% { box-shadow: 0 0 0 9px rgba(255, 207, 92, 0); } }
  @media (prefers-reduced-motion: reduce) {
    #door-hero .dh-title, #door-hero .dh-sub { opacity: 1; transform: none; animation: none !important; }
    #door-hero .dh-chip.is-primary, #door-hero .dh-tag::before, #door-hero .dh-loader { animation: none !important; }
  }

  /* ---------- scroll-driven story ---------- */
  .dh-track { position: relative; height: calc(var(--dh-steps, 4.2) * 100vh); height: calc(var(--dh-steps, 4.2) * 100svh); }
  .dh-track.dh-no-pin { height: auto; }
  #door-hero { position: sticky; top: 0; height: 100vh; height: 100svh; }
  .dh-track.dh-no-pin #door-hero { position: relative; height: clamp(460px, 88vh, 900px); }
  #door-hero .dh-scroll-only { display: none; }
  #door-hero.is-scroll .dh-scroll-only { display: inline-flex; }
  #door-hero.is-scroll .dh-world-only, #door-hero.is-scroll .dh-show-only { display: none !important; }
  #door-hero.is-scroll .dh-tools { top: calc(env(safe-area-inset-top, 0px) + 12px); bottom: auto; right: 12px; }
  #door-hero.is-scroll .dh-hint { bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 3vh, 28px)); }
  #door-hero.is-scroll.has-interacted .dh-hint { opacity: 1; transform: translateX(-50%); }
  #door-hero.is-scroll .dh-card { bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); }
  #door-hero .dh-hint svg.is-down { width: 18px; height: 14px; animation: dhBounce 1.6s ease-in-out infinite; }
  #door-hero .dh-steps { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 2; flex-direction: column; gap: 11px; }
  #door-hero .dh-steps i { width: 6px; height: 6px; border-radius: 50%; background: var(--dh-chip-line); transition: transform .3s ease, background .3s ease; }
  #door-hero .dh-steps i.on { background: var(--dh-ink); transform: scale(1.6); }
  @keyframes dhBounce { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
  @media (prefers-reduced-motion: reduce) { #door-hero .dh-hint svg.is-down { animation: none; } }

  /* ---------- phones: smaller type everywhere ---------- */
  @media (max-width: 640px) {
    #door-hero .dh-title { font-size: 22px; }
    #door-hero .dh-copy { max-width: 62vw; }
    #door-hero .dh-hint { font-size: 11.5px; padding: 7px 12px; gap: 8px; white-space: normal; text-align: center; max-width: calc(100vw - 64px); }
    #door-hero .dh-hint svg { width: 16px; height: 12px; }
    #door-hero .dh-chip { font-size: 11px; padding: 6px 10px; gap: 6px; }
    #door-hero .dh-chip svg { width: 13px; height: 13px; }
    #door-hero .dh-tag { font-size: 10.5px; padding: 4px 9px 4px 7px; gap: 5px; }
    #door-hero .dh-tag::before { width: 7px; height: 7px; }
    #door-hero .dh-card { width: min(300px, calc(100% - 20px)); padding: 10px; border-radius: 12px; }
    #door-hero .dh-card img { height: 90px; margin-bottom: 8px; }
    #door-hero .dh-card-title { font-size: 16px; margin-right: 22px; }
    #door-hero .dh-card-body { font-size: 11.5px; line-height: 1.45; }
    #door-hero .dh-card-step { font-size: 11.5px; margin-top: 8px; }
    #door-hero .dh-card-close { font-size: 20px; top: 6px; right: 8px; }
  }

  /* ---------- signature ---------- */
  #door-hero .dh-credit {
    position: absolute; left: clamp(16px, 2vw, 28px); bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(14px, 3vh, 26px));
    z-index: 2; display: flex; align-items: center; gap: 12px; pointer-events: none; color: var(--dh-ink); opacity: 0;
  }
  #door-hero.is-ready .dh-credit { animation: dhCredit 1.1s ease 1.8s forwards; }
  #door-hero .dh-credit-line { width: 36px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: .55; }
  #door-hero .dh-credit-text { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
  #door-hero .dh-credit-label { font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; opacity: .6; }
  #door-hero .dh-credit-name { font-family: "Instrument Serif", Georgia, "Times New Roman", serif; font-style: italic; font-size: 21px; letter-spacing: .01em; }
  @keyframes dhCredit { from { opacity: 0; transform: translateY(6px); } to { opacity: .92; transform: none; } }
  @media (prefers-reduced-motion: reduce) { #door-hero .dh-credit { opacity: .92; animation: none !important; } }
  @media (max-width: 640px) {
    #door-hero .dh-credit { left: auto; right: 9px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }
    #door-hero .dh-credit-line, #door-hero .dh-credit-label { display: none; }
    #door-hero .dh-credit-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 15px; }
  }

  @media (prefers-reduced-motion: reduce) {
    #door-hero canvas { transition: none; }
    #door-hero .dh-hint { transition: none; }
  }

/* ---------- WordPress uyumu ---------- */
.dh-track { --dh-top: var(--dh-offset, 0px); max-width: none; margin-top: 0; margin-bottom: 0; padding: 0; }
body.admin-bar .dh-track { --dh-top: calc(var(--dh-offset, 0px) + 32px); }
@media (max-width: 782px) { body.admin-bar .dh-track { --dh-top: calc(var(--dh-offset, 0px) + 46px); } }
#door-hero {
  visibility: visible;
  top: var(--dh-top, 0px);
  height: calc(100vh - var(--dh-top, 0px));
  height: calc(100svh - var(--dh-top, 0px));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--dh-ink);
  text-align: left;
}
.dh-track.dh-no-pin #door-hero { height: clamp(460px, 88vh, 900px); }
#door-hero, #door-hero * { box-sizing: border-box; }
#door-hero button { text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; margin: 0; min-height: 0; min-width: 0; line-height: 1.2; }
#door-hero .dh-title { color: inherit; text-transform: none; font-weight: 400; padding: 0; }
#door-hero .dh-sub, #door-hero .dh-card p { text-transform: none; letter-spacing: normal; }
#door-hero svg { max-width: none; }
#door-hero canvas { max-width: none; }
