/* Gerłowscy – strona pożegnalna */

/* ---------- Fonty (lokalnie, bez Google Fonts) ---------- */
@font-face {
  font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/cg-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/cg-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/cg-400i-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/cg-400i-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ms-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ms-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Kolory i skala ---------- */
:root {
  --bg: #0b0908;
  --ink: #eee8e1;
  --muted: rgba(238, 232, 225, .72);
  --faint: rgba(238, 232, 225, .45);
  --accent: #e8823f;
  --line: rgba(232, 130, 63, .45);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, system-ui, sans-serif;
  --gutter: clamp(20px, 6vw, 96px);
}

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

html { background: var(--bg); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 500 15px/1.85 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Zdjęcie ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

/* 4 zdjęcia na sobie, przenikanie co 8 s (cykl 32 s) */
.scene img {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  left: 12vw;                       /* zdjęcie przesunięte w prawo – miejsce na tekst */
  width: calc(100% - 12vw);
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: rotacja 32s linear infinite both;
}
.scene img:nth-child(1) { opacity: 1; object-position: 50% 55%; }                 /* hala; jedyne przy „ograniczeniu ruchu” */
.scene img:nth-child(2) { object-position: 50% 50%; animation-delay: 8s; }        /* lakierowanie */
.scene img:nth-child(3) { object-position: 50% 60%; animation-delay: 16s; }       /* Mercedes SL */
.scene img:nth-child(4) { object-position: 50% 50%; animation-delay: 24s; }       /* silnik */

/* Ciemne przejście z lewej (pod tekst) + winieta */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, var(--bg) 0%, var(--bg) 14%, rgba(11, 9, 8, .9) 34%, rgba(11, 9, 8, .55) 54%, rgba(11, 9, 8, .2) 74%, rgba(11, 9, 8, .1) 100%),
    radial-gradient(120% 90% at 62% 45%, transparent 40%, rgba(11, 9, 8, .7) 100%),
    linear-gradient(0deg, rgba(11, 9, 8, .55), transparent 30%);
}

/* Delikatne ziarno jak na odbitce (pod gradientem, więc nie odcina się na krawędziach) */
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("grain.svg");
  opacity: .07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- Treść ---------- */
.brand {
  padding: clamp(24px, 5vh, 48px) var(--gutter) 0;
  font: 500 13px/1 var(--sans);
  letter-spacing: .55em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.brand small {
  display: block;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: .62em;
  color: var(--faint);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(40px, 8vh, 96px) var(--gutter);
}

.letter { max-width: 34rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  font-size: 11px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 44px;
  height: 1px;
  background: var(--accent);
}

h1 {
  margin: 0;
  font: 400 clamp(2.6rem, 4.6vw, 4.4rem)/1.02 var(--serif);
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 em {
  display: block;
  margin-top: .12em;
  font-style: italic;
  color: var(--accent);
}

.rule {
  width: 72px;
  height: 1px;
  margin: 36px 0 32px;
  border: 0;
  background: var(--line);
}

p { margin: 0 0 1.2em; }
.letter > p { color: var(--muted); text-wrap: pretty; max-width: 31rem; }

blockquote {
  margin: 36px 0 0;
  padding: 0 0 0 24px;
  border-left: 1px solid var(--line);
  font: italic 400 clamp(1.45rem, 2vw, 1.75rem)/1.3 var(--serif);
  color: var(--ink);
}
blockquote p { margin: 0; }

.sign {
  margin: 28px 0 0;
  font-size: 11px;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--faint);
}
.sign strong { font-weight: 500; color: var(--ink); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 14px 26px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .3s, border-color .3s;
}
.back:hover { background: rgba(232, 130, 63, .12); border-color: var(--accent); }

a:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter) clamp(20px, 4vh, 36px);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Ruch ---------- */
/* Każde zdjęcie: wejście (1,6 s), powolne oddalanie, a wyjście dopiero gdy następne jest już w pełni widoczne */
@keyframes rotacja {
  0%   { opacity: 0; transform: scale(1.1); }
  5%   { opacity: 1; }
  30%  { opacity: 1; }
  35%  { opacity: 0; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.02); }
}
@keyframes wejscie {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.brand, .eyebrow, h1, .rule, .letter > p, blockquote, .sign, .back, footer {
  animation: wejscie 1s cubic-bezier(.2, .7, .2, 1) both;
}
.brand          { animation-delay: .1s; }
.eyebrow        { animation-delay: .35s; }
h1              { animation-delay: .5s; }
.rule           { animation-delay: .7s; }
.letter > p     { animation-delay: .85s; }
blockquote      { animation-delay: 1.05s; }
.sign, .back    { animation-delay: 1.2s; }
footer          { animation-delay: 1.4s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Telefon / pion: zdjęcie u góry, list pod spodem ---------- */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  .scene {
    position: absolute;
    bottom: auto;
    height: 78vh;
    height: 78svh;
    background: transparent;
    -webkit-mask-image: linear-gradient(#000 75%, transparent);
    mask-image: linear-gradient(#000 75%, transparent);
  }

  .scene img { left: 0; width: 100%; }
  .scene img:nth-child(1) { object-position: 50% 40%; }
  .scene img:nth-child(3) { object-position: 62% 50%; }
  .scene::after {
    background:
      linear-gradient(180deg, rgba(11, 9, 8, .8) 0%, rgba(11, 9, 8, 0) 20%, rgba(11, 9, 8, 0) 52%, rgba(11, 9, 8, .85) 80%, var(--bg) 100%);
  }

  body { position: relative; }
  main { align-items: flex-end; padding-top: 54vh; padding-top: 54svh; }

  .brand small { letter-spacing: .36em; line-height: 1.6; }
  .letter { max-width: 36rem; }
  h1 { font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .rule { margin: 28px 0 26px; }
  footer { flex-direction: column; gap: 6px; padding-top: 8px; }
}
