/* MINDRA — Çok Yakında */

:root {
  color-scheme: dark;
  --ink: #09070b;
  --gold-hi: #f8e6bd;
  --gold: #d9b97f;
  --gold-dim: #a68a5c;
  --mute: rgb(226 207 172 / .62);
  --line: rgb(217 185 127 / .38);

  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --caps: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --sans: "Josefin Sans", "Segoe UI", system-ui, sans-serif;

  /* Banner plate: covers the screen on wide displays, but never wider than
     108vw so the MINDRA wordmark always fits. */
  --vh: 1vh;
  --S: min(max(100vw, calc(var(--vh) * 177.7)), 108vw, calc(var(--vh) * 230));
  --A: calc(var(--vh) * 46);           /* vertical centre of the plate */

  /* Torch defaults (used when JavaScript is off) */
  --lx: 50%;
  --ly: 46%;
  --r: 46vmax;
  --d: .6;
  --tint: 255 214 160;
  --gi: 1;
}

@supports (height: 1svh) {
  :root { --vh: 1svh; }
}

@media (max-aspect-ratio: 3/4) {
  :root { --A: calc(var(--vh) * 39); }
}

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html,
body { height: 100%; }

body {
  background: var(--ink);
  color: var(--gold);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page ---------- */

.page {
  position: relative;
  isolation: isolate;
  min-height: calc(var(--vh) * 100);
  display: flex;
  flex-direction: column;
  /* Stone-coloured field behind the banner, matching its amber / amethyst edges */
  background:
    radial-gradient(70% 60% at 0% 0%, rgb(120 80 42 / .55), transparent 70%),
    radial-gradient(60% 70% at 100% 35%, rgb(58 30 104 / .5), transparent 72%),
    linear-gradient(#130e0f, #070608 72%);
}

/* ---------- Scene (banner + light) ---------- */

.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene > * {
  position: absolute;
  inset: 0;
}

.plate {
  inset: auto;
  left: 50%;
  top: var(--A);
  width: var(--S);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
  background: url("assets/banner.webp") center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
}

/* Narrower screens: the plate no longer fills the height, so melt its top and
   bottom edges into the page and spread its side lights along the page */
@media (max-aspect-ratio: 16/10) {
  .plate {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 75%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 75%, transparent 100%);
  }
  .page {
    background:
      radial-gradient(70% 34% at 0% var(--A), rgb(112 74 40 / .42), transparent 72%),
      radial-gradient(70% 34% at 100% var(--A), rgb(56 30 102 / .45), transparent 72%),
      radial-gradient(60% 40% at 0% 0%, rgb(90 60 34 / .3), transparent 70%),
      linear-gradient(#0f0b0c, #070608 80%);
  }
}

@media (max-aspect-ratio: 3/4) {
  .plate {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 29%, #000 73%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 29%, #000 73%, transparent 100%);
  }
}

/* Very wide screens: the plate stops growing, so feather its sides too */
@media (min-aspect-ratio: 23/10) {
  .plate {
    -webkit-mask-image:
      linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%),
      linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image:
      linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%),
      linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
            mask-composite: intersect;
  }
}

/* Coloured light: amber on the left, warm gold in the middle, amethyst on the right */
.glow {
  background: radial-gradient(circle calc(var(--r) * .95) at var(--lx) var(--ly),
    rgb(var(--tint) / calc(var(--gi) * .7)) 0%,
    rgb(var(--tint) / calc(var(--gi) * .28)) 40%,
    rgb(var(--tint) / 0) 75%);
  mix-blend-mode: soft-light;
}

.bloom {
  background: radial-gradient(circle calc(var(--r) * .75) at var(--lx) var(--ly),
    rgb(var(--tint) / calc(var(--gi) * .2)) 0%,
    rgb(var(--tint) / calc(var(--gi) * .06)) 45%,
    rgb(var(--tint) / 0) 75%);
  mix-blend-mode: screen;
}

/* Darkness everywhere except around the light */
.dark {
  background: radial-gradient(circle var(--r) at var(--lx) var(--ly),
    rgb(5 4 7 / 0) 0%,
    rgb(5 4 7 / calc(var(--d) * .1)) 22%,
    rgb(5 4 7 / calc(var(--d) * .6)) 56%,
    rgb(5 4 7 / calc(var(--d) * .92)) 82%,
    rgb(5 4 7 / var(--d)) 100%);
}

.sparks {
  width: 100%;
  height: 100%;
}

.grain {
  inset: 0;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Header ---------- */

.top {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:
    max(22px, env(safe-area-inset-top))
    max(28px, env(safe-area-inset-right))
    0
    max(28px, env(safe-area-inset-left));
}

.emblem {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow:
    0 0 0 1px rgb(217 185 127 / .22),
    0 8px 24px rgb(0 0 0 / .55);
}

.lang {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--mute);
}

.lang span { opacity: .5; }

.lang button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  padding: 10px 6px 8px 9px;      /* extra left pad balances the letter-spacing */
  cursor: pointer;
  position: relative;
  transition: color .3s ease;
}

.lang button::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.lang button:hover { color: var(--gold-hi); }

.lang button[aria-pressed="true"] { color: var(--gold-hi); }
.lang button[aria-pressed="true"]::after { transform: scaleX(1); }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Coming soon ---------- */

.soon {
  position: relative;
  z-index: 1;
  /* sits just below "Built with Unreal Engine" on the banner */
  margin-top: calc(var(--A) + var(--S) * .1056 + clamp(10px, calc(var(--vh) * 3), 40px));
  padding: 0 16px;
  text-align: center;
  transition: opacity .35s ease;
}

.soon.is-swapping { opacity: 0; }

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: clamp(10px, calc(var(--vh) * 1.8), 20px);
}

.ornament i {
  display: block;
  width: clamp(48px, 9vw, 110px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line));
  transform-origin: right center;
}

.ornament i:last-child {
  background: linear-gradient(to left, transparent, var(--line));
  transform-origin: left center;
}

/* the diamond echoes the gem hanging in the wordmark's "A" */
.ornament b {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgb(255 190 110 / .35);
}

.soon-title {
  font-weight: inherit;
  line-height: 1;
}

.soon-word {
  display: inline-block;
  font-family: var(--caps);
  font-weight: 500;
  font-size: clamp(1.55rem, min(4.6vw, calc(var(--vh) * 6.2)), 3.3rem);
  letter-spacing: .34em;
  margin-right: -.34em;   /* cancels trailing letter-spacing so it stays centred */
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 1px 0 rgb(0 0 0 / .6);
}

.soon-word .ch {
  --lit: 0;
  display: inline-block;
  color: color-mix(in oklab, var(--gold-dim), var(--gold-hi) calc(var(--lit) * 100%));
  text-shadow:
    0 1px 0 rgb(0 0 0 / .65),
    0 0 calc(2px + var(--lit) * 22px) rgb(255 186 104 / calc(var(--lit) * .6));
}

.soon-line {
  margin-top: clamp(10px, calc(var(--vh) * 2), 22px);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.02rem, calc(var(--vh) * 2.4), 1.38rem);
  letter-spacing: .01em;
  color: var(--mute);
}

/* ---------- Footer: copyright · hint · follow ---------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "hint hint"
    "copy follow";
  align-items: center;
  gap: 8px 24px;
  padding:
    24px
    max(28px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgb(226 207 172 / .45);
}

@media (min-width: 1180px) {
  .foot {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "copy hint follow";
  }
}

.copy {
  grid-area: copy;
  justify-self: start;
  font-size: inherit;
}

.hint {
  grid-area: hint;
  justify-self: center;
  text-align: center;
  letter-spacing: .26em;
  color: var(--mute);
  opacity: 0;
  transition: opacity 1.2s ease;
}

.follow {
  grid-area: follow;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.follow-label {
  color: var(--mute);
  white-space: nowrap;
}

.follow-label::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  margin-left: 14px;
  vertical-align: .3em;
  background: var(--line);
}

.socials {
  display: flex;
  gap: 4px;
}

/* Each icon sits in a small gold diamond, like the gem in the wordmark's "A".
   --lit is set by main.js when the torch passes close by. */
.social {
  --lit: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: color-mix(in oklab, var(--gold-dim), var(--gold-hi) calc(var(--lit) * 100%));
  text-decoration: none;
  transition: color .3s ease;
}

.social::before {
  content: "";
  position: absolute;
  inset: 9px;
  transform: rotate(45deg);
  border: 1px solid rgb(217 185 127 / calc(.3 + var(--lit) * .45));
  background: rgb(9 7 11 / .45);
  box-shadow: 0 0 calc(var(--lit) * 18px) rgb(255 186 104 / calc(var(--lit) * .35));
  transition: border-color .3s ease, box-shadow .3s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
}

.social svg {
  position: relative;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.social:hover,
.social:focus-visible { color: var(--gold-hi); }

.social:hover::before,
.social:focus-visible::before {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgb(255 186 104 / .4);
  transform: rotate(45deg) scale(1.08);
}

.social:focus-visible { outline: none; }

/* Small label above the icon: the handle, or "Yakında" when the link isn't set yet */
.social::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  padding-left: .2em;               /* balances the trailing letter-spacing */
  transform: translate(-50%, 4px);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--gold-hi);
  text-shadow: 0 1px 6px rgb(0 0 0 / .9);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s ease;
}

.social:hover::after,
.social:focus-visible::after,
.social.is-tipped::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* a handle is shown exactly as typed (Turkish uppercase would turn i into İ) */
.social:not(.is-soon)::after {
  text-transform: none;
  font-size: 11px;
  letter-spacing: .08em;
  padding-left: .08em;
}

.social.is-soon { cursor: default; }

.hint span::before,
.hint span::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin: 0 12px;
  vertical-align: .3em;
  background: var(--line);
}

.hint.is-shown { opacity: .85; }
.hint.is-gone { opacity: 0; transition-duration: .8s; }

@media (max-width: 700px) {
  .top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .emblem { width: 36px; height: 36px; border-radius: 8px; }
  .foot {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hint"
      "follow"
      "copy";
    justify-items: center;
    gap: 14px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    text-align: center;
  }
  .copy,
  .follow { justify-self: center; }
  .follow { flex-direction: column; gap: 16px; }   /* room for the "Yakında" label above an icon */
  .follow-label::after { display: none; }
  .hint { letter-spacing: .18em; font-size: 10px; }
  .hint span::before,
  .hint span::after { display: none; }
}

@media (max-height: 720px) {
  .foot { padding-top: 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

@media (max-height: 460px) {
  .hint { display: none; }
}

/* ---------- Intro (only when JavaScript runs) ---------- */

.js .top,
.js .foot,
.js .soon-line {
  opacity: 0;
  transition: opacity 1.4s ease;
}

.js .ornament i { transform: scaleX(0); transition: transform 1.3s cubic-bezier(.2, .7, .2, 1); }
.js .ornament b { opacity: 0; transform: rotate(45deg) scale(.4); transition: opacity .8s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }

.js .soon-word .ch {
  opacity: 0;
  transform: translateY(.22em);
  filter: blur(5px);
  transition:
    opacity 1s ease,
    transform 1.2s cubic-bezier(.2, .7, .2, 1),
    filter 1s ease;
  transition-delay: calc(700ms + var(--i, 0) * 75ms);
}

.js.is-lit .top { opacity: 1; transition-delay: 1.6s; }
.js.is-lit .foot { opacity: 1; transition-delay: 2s; }
.js.is-lit .soon-line { opacity: 1; transition-delay: 1.7s; }
.js.is-lit .ornament i { transform: scaleX(1); transition-delay: .4s; }
.js.is-lit .ornament b { opacity: 1; transform: rotate(45deg); transition-delay: .5s; }
.js.is-lit .soon-word .ch { opacity: 1; transform: none; filter: none; }

/* After the intro, letters shouldn't wait for their stagger again (e.g. language switch) */
.js.is-settled .soon-word .ch { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .js .top,
  .js .foot,
  .js .soon-line,
  .js .ornament i,
  .js .ornament b,
  .js .soon-word .ch,
  .hint {
    transition: none !important;
  }
}
