/* TagU — sklep.tagu.pl (temporary landing)
   Single static page. No external requests. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-pl.woff2") format("woff2");
  font-weight: 250 600;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback keeps layout stable while the webfont swaps in. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

:root {
  --bg: #0a0a0b;
  --bg-lift: #121214;
  --ink: #edebe6;          /* bone */
  --ink-2: #a7a49e;        /* body copy   — 8.1:1 */
  --ink-3: #8b8882;        /* small meta  — 5.6:1 */
  --ink-soft: #6b6964;     /* display-only, large text — 3.6:1 */
  --line: rgb(237 235 230 / 0.11);
  --accent: #f0b54a;       /* single signal colour: "in progress" */

  --gutter: clamp(1.25rem, 0.6rem + 3.4vw, 3.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  font-feature-settings: "cv11" 1, "calt" 1; /* single-storey "a", as in the TagU wordmark */
  color: var(--ink);
  background:
    radial-gradient(110% 85% at 88% 42%, var(--bg-lift) 0%, rgb(18 18 20 / 0) 62%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fine film grain — breaks up gradient banding on large dark surfaces. */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }

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

.skip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}
.skip:focus-visible { transform: none; }

/* ------------------------------------------------------------------ layout */

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding-inline: var(--gutter);
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  overflow: hidden;
  overflow: clip;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.25rem, 0.8rem + 1.6vw, 2.25rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: -0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
}

.brand__mark {
  width: 1.5rem;
  height: 1.5rem;
  fill: var(--ink);
  transition: opacity 0.4s ease;
}
.brand:hover .brand__mark { opacity: 0.7; }

.brand__word {
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: 0.34em;
  margin-right: -0.34em; /* trailing tracking */
  line-height: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.status__dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--accent);
  animation: ping 2.4s var(--ease-out) 2.2s 1; /* one signal pulse once the page settles */
}

/* ----------------------------------------------------------------- monogram */

.monogram {
  position: absolute;
  z-index: 0;
  grid-row: 1 / 3;   /* containing block spans masthead + hero rows … */
  bottom: 0;         /* … so the curve rests exactly on the footer rule */
  right: -13vw;
  width: min(80svh, 58vw, 820px);
  aspect-ratio: 1;
  pointer-events: none;
}

.monogram svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.monogram__fill {
  fill: rgb(237 235 230 / 0.018);
  opacity: 0;
  animation: fade-in 2s ease 1.5s forwards;
}

/* Stroke width is in viewBox units (~1 device px at the rendered size).
   non-scaling-stroke is avoided: it breaks pathLength-based dashes in Chromium. */
.monogram__line {
  fill: none;
  stroke-width: var(--hair, 0.42);
  stroke-linejoin: round;
}

.monogram__line {
  stroke: rgb(237 235 230 / 0.2);
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: draw 2.4s var(--ease-io) 0.35s forwards;
}
.monogram__line--inner { animation-delay: 0.75s; }


/* -------------------------------------------------------------------- hero */

/* One display size drives the whole hero: headline, the lede's hanging axis and
   the vertical rhythm are all derived from it, so proportions hold at every size. */
.hero {
  --display: clamp(2.875rem, min(0.75rem + 10.4vw, 16.5svh), 10.5rem);
  --axis: 2.442;  /* ink-left of the "s" in "sklep", in em (measured on render) */
  --beat: clamp(2rem, 0.3 * var(--display), 3.5rem); /* headline → lede → rule */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: clamp(2rem, 6svh, 6rem) var(--beat);
}

.headline {
  margin: 0;
  font-size: var(--display);
  font-weight: 300;
  font-variation-settings: "opsz" 32;
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.headline__line {
  display: block;
  /* clip box for the rise animation; padding keeps Ż / descenders unclipped */
  overflow: hidden;
  overflow: visible clip;
  /* The clip reaches well below the baseline so descenders (the g of "TagU")
     clear it during the fast part of the rise — mid-motion it never reads "TaaU". */
  padding-block: 0.07em 0.32em;
  margin-block: -0.07em -0.32em;
  margin-left: -0.055em; /* optical alignment of large glyph side-bearings */
}
.headline__line:nth-child(1) { margin-left: -0.075em; } /* N */
.headline__line:nth-child(2) { margin-left: -0.035em; } /* T overhangs slightly */
.headline__line > span { display: inline-block; }
.headline__line--soft {
  /* No descenders here, so the shallow clip is enough — and it keeps the rising
     line from passing over the lede as that fades in. */
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  margin-top: -0.015em; /* clears the g descender above the ż dot */
  color: var(--ink-soft);
}

/* The lede hangs from the "s" of "sklep"; a hairline leader carries the eye
   from the margin to that axis, so the indent reads as intended. */
.lede {
  --indent: calc(var(--display) * var(--axis));
  position: relative;
  margin: var(--beat) 0 0 var(--indent);
  max-width: 44ch;   /* each sentence holds one line on desktop */
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: balance;
}
.lede__s { display: block; }

.lede::before {
  content: "";
  position: absolute;
  top: 0.86em;               /* x-height centre of the first line */
  right: calc(100% + 1.25rem);
  width: calc(var(--indent) - 1.25rem);
  height: 1px;
  background: rgb(237 235 230 / 0.15);
  /* No own animation: it arrives with the lede's fade. (Animating this pseudo-element
     while its parent animates left it unpainted in Chromium.) */
}

/* Understated inline link — the only route on to tagu.pl besides the logo. */
.inline-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  text-decoration-color: rgb(237 235 230 / 0.32);
  transition: text-decoration-color 0.35s ease, color 0.35s ease;
}
.inline-link:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration-color: var(--ink);
}
@media (hover: hover) {
  .inline-link:hover { text-decoration-color: var(--ink); }
}
@media (pointer: coarse) {
  .inline-link { padding-block: 0.45em; margin-block: -0.45em; }
}

/* ---------------------------------------------------------------- colophon */

.colophon {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-block: 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.colophon p { margin: 0; }

.colophon__address {
  justify-self: end;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------- entrances */

.reveal {
  animation: fade-up 1.1s var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
}
.d1 { --d: 1; }
.d2 { --d: 2; }
.d3 { --d: 3; }
.d5 { --d: 5; }
.headline .reveal {
  animation-name: rise;
  animation-duration: 1.25s;
}

@keyframes rise {
  from { transform: translateY(150%); } /* starts fully below the deeper clip */
  to   { transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ping {
  0%   { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}


/* ------------------------------------------------------------- responsive */

/* Side-by-side (landscape) composition */
@media (min-width: 961px) and (min-aspect-ratio: 4/5) {
  /* The -2 viewBox margin would leave the curve a few px short of the rule. */
  .monogram { translate: 0 calc(100% * 2 / 300); }
}

/* Proximity: the lede belongs to the headline, not to the footer band. */
@media (min-width: 641px) {
  .lede { margin-top: calc(var(--beat) * 0.8); }
  .hero { padding-bottom: calc(var(--beat) * 1.45); }
}

@media (max-width: 960px), (max-aspect-ratio: 4/5) {
  /* Stacked composition: the mark is sized from the height left above the
     headline (≈ 100svh − masthead − text block − footer), so it sits over the
     type with a constant gap instead of colliding with it. */
  .monogram {
    --m: min(clamp(16rem, calc(100svh - 21.75rem - 35vw), 68vw), 560px);
    top: clamp(4.5rem, 10svh, 7rem);
    bottom: auto;
    width: var(--m);
    right: calc(var(--m) * -0.24);
  }

  .hero { --display: clamp(2.875rem, min(13vw, 14svh), 8rem); }
}

@media (max-width: 640px) {
  .monogram {
    --hair: 0.7;
    --m: clamp(50vw, calc(100svh - 19.5rem - 46vw), 94vw);
    top: 4.5rem;
    /* soft fade only matters on short phones, where the minimum size reaches the type */
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, rgb(0 0 0 / 0.4) 100%);
    mask-image: linear-gradient(to bottom, #000 60%, rgb(0 0 0 / 0.4) 100%);
  }

  .hero {
    --display: min(17vw, 5.75rem);
    --beat: 1.75rem;
    padding-block: 1.75rem 2.5rem;
  }

  /* Too narrow to hang from the axis: the lede returns to the margin. */
  .lede {
    --indent: 0px;
    max-width: 30ch;
    font-size: 1.0625rem;
  }
  .lede__s { display: block; }

.lede::before { display: none; }
}

@media (max-width: 400px) {
  .status { letter-spacing: 0.12em; }
}

/* Squarer desktops (5:4, 4:3, 16:10-ish tall windows): the height-led mark would
   reach into the type, so size it from the width and bleed it further. */
@media (min-width: 961px) and (min-aspect-ratio: 4/5) and (max-aspect-ratio: 3/2) {
  .monogram {
    width: min(80svh, 48vw, 820px);
    right: -16vw;
  }
}

/* Narrow desktops: bleed the mark further so it clears the headline. */
@media (min-width: 961px) and (max-width: 1200px) and (min-aspect-ratio: 4/5) {
  .monogram { right: -22vw; }
  .lede { max-width: 34ch; } /* stay clear of the mark's left stem */
}

/* Common laptop heights (768 / 720): keep the whole composition above the fold. */
@media (max-height: 800px) and (min-width: 961px) and (min-aspect-ratio: 4/5) {
  .hero { --display: clamp(2.875rem, min(0.75rem + 10.4vw, 15.5svh), 10.5rem); }
  .lede { font-size: 1rem; }
}

/* Short, wide screens (landscape phones, small laptops) */
@media (max-height: 560px) and (min-width: 641px) {
  .hero { padding-block: 3rem 2rem; }
  .monogram {
    --m: min(62svh, 34vw);
    width: var(--m);
  }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .status__dot::after { display: none; }
}

@media (forced-colors: active) {
  .monogram { display: none; }
}
