/* =====================================================================
   Bege Lab · v4 "Link" — avenox tarzı dikey link sayfası, BEG-01 ile
   Yalnızca html[data-ui="links"] altında görünür. v1–v3'e dokunmaz.
   ===================================================================== */

/* ---------- 1. Görünüm geçişi ---------- */
html:not([data-ui="links"]) .l4 { display: none !important; }
html[data-ui="links"] .page-shell,
html[data-ui="links"] .noise,
html[data-ui="links"] .lx,
html[data-ui="links"] .lx-toast,
html[data-ui="links"] .d3 { display: none !important; }
html[data-ui="links"] body::before,
html[data-ui="links"] body::after { display: none !important; }
html[data-ui="links"] body { background: #f3efe4; color: #1d1b16; }

/* ---------- 2. Tokenlar ---------- */
.l4 {
  --bg: #f3efe4;
  --card: #fffdf8;
  --ink: #1d1b16;
  --ink-2: #3a362d;
  --muted: #736b5b;
  --line: rgba(29, 27, 22, .12);
  --yellow: #f5b92e;
  --yellow-2: #e9a91b;
  --screen: #1b1b18;
  --pixel: #f4e9cc;
  --sans: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
.l4 *, .l4 *::before, .l4 *::after { box-sizing: border-box; }
.l4 ::selection { background: var(--yellow); color: var(--ink); }
.l4 [data-status="LIVE"] { --st: #2fae62; }
.l4 [data-status="BUILDING"] { --st: #e3a318; }
.l4 [data-status="PROTOTYPE"] { --st: #ee6a2f; }
.l4 [data-status="LAB"] { --st: #7d68f0; }
.l4 [data-status="SOON"] { --st: #9d9580; }
.l4 [data-status="ONGOING"] { --st: #3d9bd6; }

/* ---------- 3. Arka plan: dev nokta-matris yüz ---------- */
.l4-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(245, 185, 46, .16), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(29, 27, 22, .06), transparent 70%),
    var(--bg);
}
.l4-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask: radial-gradient(circle, #000 0 2.1px, transparent 2.7px) 0 0 / 10px 10px;
  mask: radial-gradient(circle, #000 0 2.1px, transparent 2.7px) 0 0 / 10px 10px;
  opacity: 1;
  animation: l4FaceIn 1.4s ease both .3s;
}
.l4-eye path { fill: rgba(29, 27, 22, .2); }
.l4-pupil { fill: var(--bg); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.l4-mouth { fill: rgba(233, 169, 27, .55); }

/* ---------- 4. Üst çubuk (paylaş) ---------- */
.l4-topbar {
  position: fixed;
  z-index: 50;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}
.l4-share {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, .85);
  color: var(--ink);
  box-shadow: 0 6px 16px -10px rgba(60, 45, 20, .5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.l4-share:hover { transform: translateY(-1px); background: #fff; }
.l4-share:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }
.l4-share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 5. Sütun ---------- */
.l4-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(580px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(64px, 11vh, 110px) 0 0;
  text-align: center;
}

/* Yukarıdan düşerek gelme */
.l4-drop { animation: l4Drop .7s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--d, 0) * 80ms + 80ms); }

/* Avatar */
.l4-avatar { position: relative; width: 132px; aspect-ratio: 1; }
.l4-avatar__btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f3ecd8;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 7px var(--yellow),
    0 18px 30px -14px rgba(60, 45, 20, .55);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
  -webkit-tap-highlight-color: transparent;
}
.l4-avatar__btn:hover { transform: rotate(-4deg) scale(1.04); }
.l4-avatar__btn:active { transform: scale(.96); }
.l4-avatar__btn:focus-visible { outline: 2px dashed var(--ink); outline-offset: 10px; }
.l4-avatar__btn img {
  position: absolute;
  inset: -4% -4% -2% -4%;
  width: 108%;
  height: auto;
  pointer-events: none;
  user-select: none;
}
/* Göz kapakları (görsel üzerinde, %108 ölçekli yerleşim) */
.l4-lid {
  position: absolute;
  top: calc(-4% + 50.6% * 1.08 * 697 / 720);
  height: 8.6%;
  background: #27231d;
  border-radius: 0 0 50% 50% / 0 0 30% 30%;
  transform: scaleY(0);
  transform-origin: top;
}
.l4-lid--l { left: calc(-4% + 24.2% * 1.08); width: calc(13.4% * 1.08); }
.l4-lid--r { left: calc(-4% + 44.7% * 1.08); width: calc(13.4% * 1.08); }
.l4-avatar.is-blinking .l4-lid { animation: l4Blink .24s ease-in-out; }
.l4-online {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 20px;
  height: 20px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: #2fae62;
  box-shadow: 0 0 0 0 rgba(47, 174, 98, .5);
  animation: l4Pulse 2.2s ease-out infinite;
}

/* Konuşma balonu */
.l4-bubble {
  position: relative;
  max-width: 100%;
  min-height: 44px;
  margin: 22px 0 18px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 24px -18px rgba(60, 45, 20, .6);
}
.l4-bubble::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: var(--card);
  transform: rotate(45deg);
}
.l4-bubble p {
  position: relative;
  margin: 0;
  font: 600 13.5px/1.45 var(--mono);
  color: var(--ink-2);
}
.l4-bubble p::after {
  content: '';
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 3px;
  background: var(--yellow-2);
  vertical-align: -.18em;
  animation: l4Caret 1s steps(1) infinite;
}

.l4-name {
  margin: 0;
  font: 800 clamp(42px, 9vw, 60px)/.95 var(--display);
  letter-spacing: -.045em;
  color: var(--ink);
  text-shadow: none;
}
.l4-sub {
  margin: 10px 0 0;
  font: 500 15px/1.4 var(--sans);
  color: var(--muted);
}
.l4-sub span { margin: 0 4px; opacity: .6; }
.l4-tag {
  margin: 14px 0 0;
  font: 600 clamp(13px, 3.3vw, 14.5px)/1.5 var(--mono);
  color: var(--ink-2);
}
.l4-tag span { color: var(--yellow-2); }
.l4-tag i {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 4px;
  background: var(--ink);
  vertical-align: -.18em;
  animation: l4Caret 1s steps(1) infinite;
}

/* Çipler */
.l4-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
}
.l4-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .75);
  color: var(--muted);
  font: 600 12px/1 var(--mono);
}
.l4-chip b { color: var(--ink); font-weight: 800; }
.l4-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st, #9d9580);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, #9d9580) 20%, transparent);
}
.l4-coffee { cursor: pointer; transition: border-color .2s, background .2s; }
.l4-coffee:hover { border-color: var(--ink); background: #fff; }
.l4-coffee:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
.l4-coffee__bar {
  position: relative;
  width: 26px;
  height: 8px;
  border: 1.5px solid var(--ink-2);
  border-radius: 3px;
  overflow: hidden;
}
.l4-coffee__bar::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 1px;
  width: 2px;
  height: 3px;
  background: var(--ink-2);
}
.l4-coffee__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 12%;
  background: #b8742a;
  transition: width .6s cubic-bezier(.2, .8, .2, 1), background .3s;
}
.l4-coffee.is-low .l4-coffee__bar i { background: #e2553a; animation: l4Low 1s steps(1) infinite; }

/* Bölücü */
.l4-div {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 34px 0 14px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.l4-div::before, .l4-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.l4-div--end { margin: 26px 0 0; text-transform: none; letter-spacing: .04em; }

/* ---------- 6. Link kartları ---------- */
.l4-links { display: grid; gap: 12px; width: 100%; }
.l4-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px -18px rgba(60, 45, 20, .55);
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s;
  animation: l4Drop .65s cubic-bezier(.2, .9, .3, 1.25) both;
  animation-delay: calc(var(--i, 0) * 90ms + 620ms);
  -webkit-tap-highlight-color: transparent;
}
.l4-card:hover, .l4-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(29, 27, 22, .45);
  box-shadow: inset 0 1px 0 #fff, 0 16px 30px -18px rgba(60, 45, 20, .7);
  outline: none;
}
.l4-card:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.l4-card:active { transform: translateY(0) scale(.99); }
.l4-card.is-shake { animation: l4Shake .35s ease-out; }

/* Mini nokta-matris ekran ikonu */
.l4-ic {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .07) 0 .8px, transparent 1.2px) 0 0 / 4px 4px,
    var(--screen);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.l4-ic svg { width: 34px; height: 34px; fill: var(--pixel); filter: drop-shadow(0 0 2.5px rgba(255, 222, 150, .65)); }
.l4-ic b { color: var(--pixel); font: 800 15px/1 var(--mono); text-shadow: 0 0 4px rgba(255, 222, 150, .6); }
.l4-card:hover .l4-ic svg { animation: l4Flicker .4s steps(2) 1; }

.l4-txt { min-width: 0; }
.l4-txt b {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font: 700 16.5px/1.25 var(--sans);
  letter-spacing: -.01em;
}
.l4-txt small {
  display: block;
  margin-top: 3px;
  font: 500 13.5px/1.35 var(--sans);
  color: var(--muted);
}
.l4-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 10px/1 var(--mono);
  font-style: normal;
  letter-spacing: .08em;
  color: color-mix(in srgb, var(--st) 85%, #000);
}
.l4-st::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--st);
}
.l4-st[data-status="LIVE"]::before { animation: l4PulseDot 2s ease-out infinite; }
.l4-go {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  transition: background .2s, transform .2s;
}
.l4-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.l4-card:hover .l4-go { background: var(--yellow); transform: rotate(-10deg); }
.l4-soon { font: 700 10px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }

/* Bağlantısı olmayan kartlar */
.l4-card.is-soon { background: rgba(255, 253, 248, .6); box-shadow: none; }
.l4-card.is-soon .l4-ic svg { fill: #d9ccab; filter: drop-shadow(0 0 2px rgba(255, 222, 150, .35)); opacity: .85; }
.l4-card.is-soon:hover { transform: none; border-color: var(--line); }

/* Öne çıkan kart */
.l4-card.is-featured {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  padding: 16px 16px 16px 14px;
  border: 1.5px solid var(--ink);
  background: linear-gradient(180deg, #f8c64a, var(--yellow));
  box-shadow: 0 4px 0 var(--ink), 0 18px 30px -18px rgba(60, 45, 20, .7);
}
.l4-card.is-featured:hover { box-shadow: 0 6px 0 var(--ink), 0 22px 34px -18px rgba(60, 45, 20, .75); }
.l4-card.is-featured .l4-ic { width: 64px; height: 64px; border-radius: 17px; }
.l4-card.is-featured .l4-ic svg { width: 40px; height: 40px; fill: var(--yellow); filter: drop-shadow(0 0 3px rgba(245, 185, 46, .8)); }
.l4-card.is-featured .l4-txt b { font-size: 19px; }
.l4-card.is-featured .l4-txt small { color: rgba(29, 27, 22, .72); }
.l4-card.is-featured .l4-st { color: #0f5a2d; }
.l4-card.is-featured .l4-go { background: var(--ink); color: var(--yellow); width: 40px; height: 40px; }
.l4-card.is-featured:hover .l4-go { background: var(--ink); }
.l4-ribbon {
  position: absolute;
  top: -10px;
  right: 18px;
  padding: 4px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font: 800 9.5px/1 var(--mono);
  letter-spacing: .1em;
  color: var(--ink);
  transform: rotate(3deg);
}

/* ---------- 7. Alt bilgi ---------- */
.l4-foot {
  position: relative;
  z-index: 1;
  padding: 44px 16px max(40px, env(safe-area-inset-bottom));
  text-align: center;
  font: 600 12px/1.6 var(--mono);
  color: var(--muted);
}
.l4-foot p { margin: 0; }
.l4-foot__small { font-size: 10.5px; letter-spacing: .1em; opacity: .75; }

/* ---------- 8. Animasyonlar ---------- */
@keyframes l4Drop { from { opacity: 0; transform: translateY(-26px); } }
@keyframes l4FaceIn { from { opacity: 0; } }
@keyframes l4Blink { 0%, 100% { transform: scaleY(0); } 45%, 55% { transform: scaleY(1); } }
@keyframes l4Caret { 50% { opacity: 0; } }
@keyframes l4Pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 174, 98, .5); } 80%, 100% { box-shadow: 0 0 0 10px rgba(47, 174, 98, 0); } }
@keyframes l4PulseDot { 0% { box-shadow: 0 0 0 0 rgba(47, 174, 98, .6); } 80%, 100% { box-shadow: 0 0 0 6px rgba(47, 174, 98, 0); } }
@keyframes l4Shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes l4Flicker { 50% { opacity: .55; } }
@keyframes l4Low { 50% { opacity: .35; } }

/* ---------- 9. Duyarlı ---------- */
@media (max-width: 720px) {
  .l4-face { opacity: .75; }
  .l4-col { padding-top: 70px; }
  .l4-avatar { width: 116px; }
  .l4-card { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; padding: 11px 12px 11px 11px; border-radius: 18px; }
  .l4-ic { width: 50px; height: 50px; border-radius: 14px; }
  .l4-ic svg { width: 30px; height: 30px; }
  .l4-card.is-featured { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .l4-card.is-featured .l4-ic { width: 58px; height: 58px; }
  .l4-txt b { font-size: 15.5px; }
  .l4-txt small { font-size: 13px; }
}
@media (hover: none) {
  .l4-card:hover { transform: none; }
  .l4-avatar__btn:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .l4 *, .l4 *::before, .l4 *::after { animation: none !important; transition: none !important; }
}
