/* ============================================================
   denizeozgurluk.com — "gece denizi anıt" (night-sea memorial)
   Solemn, editorial, dignified. The accent is the sea.
   ============================================================ */

:root {
  --ink: #0c1116;      /* ink-navy ground */
  --paper: #e9e4d8;    /* bone text */
  --sea: #5e93b8;      /* sea-blue accent — "Deniz" means sea */
  --muted: #77828e;    /* muted secondary */
  --line: rgba(233, 228, 216, .14);   /* hairlines */
  --line-strong: rgba(233, 228, 216, .28);

  --serif: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --column: 44rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink); /* fallback ground (e.g. iOS rubber-band overscroll) */
}

body {
  margin: 0;
  /* no background here — a fixed pseudo-element (body::after) now paints the
     site-wide photo. Body must stay transparent or its own in-flow background
     would paint OVER the negative-z-index fixed layer (it out-ranks it in the
     root stacking context's paint order). */
  background: transparent;
  color: var(--paper);
  font-family: var(--body);
  font-size: 1.08rem;
  line-height: 1.75;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Site-wide fixed background — the "Ölü Deniz" stage-set photo (giant
   severed-head sculpture on the red-curtained stage), visible behind every
   section, not just the hero. The dark ink gradient is layered directly into
   the background so it never fights for stacking order with page content;
   z-index:-1 keeps it behind the (non-positioned) in-flow content above. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(12, 17, 22, .78), rgba(12, 17, 22, .9)),
    url("assets/bas.jpg") center 30% / cover no-repeat var(--ink);
}

/* Fine grain overlay — inline feTurbulence, site-wide, non-interactive */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
img[hidden] { display: none; }

a {
  color: var(--sea);
  text-decoration: none;
  text-underline-offset: .2em;
  text-decoration-thickness: 1px;
  transition: color .2s var(--ease);
}
a:hover { color: var(--paper); text-decoration: underline; }

em { font-style: italic; }

::selection { background: rgba(94, 147, 184, .32); color: var(--paper); }

/* ---------- Utility ---------- */
.mono {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: .01em;
}

/* ============================================================
   Header
   ============================================================ */
.site-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-name { color: var(--muted); }

.share-btn:focus-visible,
a:focus-visible {
  outline: 1px solid var(--sea);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Hero — the memorial counter
   ============================================================ */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.6rem;
  padding: 4rem var(--gutter) 6rem;
  overflow: hidden;
}

/* sea-blue radial glow rising from the horizon at the base */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 140vw;
  height: 55vh;
  transform: translateX(-50%);
  background: radial-gradient(60% 100% at 50% 100%,
              rgba(94, 147, 184, .22) 0%,
              rgba(94, 147, 184, .07) 38%,
              transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.overline {
  margin: 0;
  color: var(--sea);
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.015em;
}

/* Counter */
.counter {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(1.1rem, 5vw, 3rem);
  margin: .4rem 0 .2rem;
}
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.num {
  font-family: var(--mono);
  font-weight: 300;
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--paper);
}
.lab {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-sub {
  margin: 0;
  max-width: 34rem;
  color: var(--paper);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-style: italic;
  font-family: var(--serif);
  font-weight: 300;
  opacity: .9;
}

/* horizon line at the base of the hero */
.horizon {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(90%, 60rem);
  height: 1px;
  z-index: 1;
  background: linear-gradient(90deg,
              transparent,
              var(--line-strong) 18%,
              rgba(94, 147, 184, .5) 50%,
              var(--line-strong) 82%,
              transparent);
}

/* Staggered load animation on hero children */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(1.4rem); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero .overline,
.hero h1,
.hero .counter,
.hero .hero-sub {
  opacity: 0;
  animation: fade-up 1s var(--ease) forwards;
}
.hero .overline  { animation-delay: .15s; }
.hero h1         { animation-delay: .35s; }
.hero .counter   { animation-delay: .6s; }
.hero .hero-sub  { animation-delay: .85s; }
.horizon {
  opacity: 0;
  animation: fade-up 1.2s var(--ease) 1.1s forwards;
}

/* ============================================================
   Sections — narrow editorial column
   ============================================================ */
.section {
  max-width: var(--column);
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6rem) var(--gutter);
  border-top: 1px solid var(--line);
}
.photo-section { border-top: 0; padding-top: clamp(2.5rem, 6vw, 4rem); }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}

/* Prose */
.prose p {
  margin: 0 0 1.35rem;
  color: var(--paper);
}
.prose p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono);
  font-size: .86em;
  color: var(--sea);
  background: rgba(94, 147, 184, .1);
  padding: .1em .4em;
  border-radius: 3px;
}

.standfirst {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.45;
  color: var(--paper);
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--sea);
}

/* Sources list */
.sources {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: .8rem;
  letter-spacing: .04em;
}
.sources li { position: relative; }
.sources li + li::before {
  content: "·";
  position: absolute;
  left: -.9rem;
  color: var(--muted);
}
.sources a { color: var(--muted); }
.sources a:hover { color: var(--sea); }

/* ============================================================
   Photo frame
   ============================================================ */
.photo-frame {
  margin: 0;
  padding: .75rem;
  border: 1px solid var(--line);
  background: rgba(233, 228, 216, .015);
}
.photo-frame img {
  width: 100%;
  filter: saturate(.9) brightness(.95);
}
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 3 / 2;
  padding: 2rem;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}
.placeholder[hidden] { display: none; }
.placeholder code {
  font-family: var(--mono);
  color: var(--sea);
  font-size: .85em;
}
.photo-frame figcaption {
  margin-top: .85rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .05em;
  line-height: 1.5;
}

/* ============================================================
   Address card — envelope feel
   ============================================================ */
.address-card {
  margin: 1.75rem 0;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(180deg, rgba(94, 147, 184, .05), transparent 60%),
    rgba(233, 228, 216, .02);
  border-radius: 2px;
}
.address-card pre {
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: .92rem;
  line-height: 1.7;
  color: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Tips */
.tips {
  margin: 1.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}
.tips li { margin-bottom: .75rem; }
.tips li:last-child { margin-bottom: 0; }
.tips li::marker { color: var(--sea); }

/* ============================================================
   Share buttons — pills that fill with the sea on hover
   ============================================================ */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.75rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: none;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .6rem 1.25rem;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .05em;
  color: var(--paper);
  text-decoration: none;
  transition: background-color .2s var(--ease),
              color .2s var(--ease),
              border-color .2s var(--ease);
}
.share-btn:hover,
.share-btn:focus-visible {
  background: var(--sea);
  color: var(--ink);
  border-color: var(--sea);
  text-decoration: none;
}
/* address copy button sits inside the card */
.address-card .share-btn { align-self: flex-start; }

/* ============================================================
   Footer
   ============================================================ */
.site-foot {
  max-width: var(--column);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 4.5rem) var(--gutter) 5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.7;
  letter-spacing: .03em;
}
.site-foot p { margin: 0; max-width: 40rem; }

/* ============================================================
   Toast — fixed bottom-center, revealed via .show
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translate(-50%, 1.5rem);
  z-index: 10000;
  max-width: calc(100vw - 2rem);
  padding: .8rem 1.35rem;
  background: #141c24;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .03em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast[hidden] { display: none; }
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Responsive — under 640px
   ============================================================ */
@media (max-width: 640px) {
  body { font-size: 1.02rem; }

  .counter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1.25rem;
    width: 100%;
    max-width: 22rem;
  }

  .share-row { gap: .55rem; }
  .share-btn { padding: .55rem 1.05rem; font-size: .76rem; }

  .sec-head { gap: .75rem; }
  .sources { gap: .35rem 1.2rem; }
}

@media (max-width: 380px) {
  .num { font-size: clamp(1.9rem, 13vw, 2.4rem); }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .overline,
  .hero h1,
  .hero .counter,
  .hero .hero-sub,
  .horizon {
    animation: none;
    opacity: 1;
    transform: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
