/* facetdigital.si
   Brand palette (teal + green scales) and Proxima Nova.
   All fonts are self-hosted so the CSP can stay at 'self'. */

@font-face {
  font-family: "Proxima Nova";
  src: url("/fonts/proxima-nova-regular-fixed.7da545b6a4.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/fonts/proxima-nova-semibold.59bb4c7c90.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/fonts/proxima-nova-extrabold.da42406399.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("/fonts/proxima-nova-italic.5c6c138e5c.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-italic.1d6e1bd7bc.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DSEG7";
  src: url("/fonts/dseg7-bold.ec2e7499bc.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

@font-face {
  font-family: "DSEG14";
  src: url("/fonts/dseg14-bold.a73df6e665.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

:root {
  --teal-50: #f3f8f8;
  --teal-100: #dfecee;
  --teal-200: #c3dbde;
  --teal-300: #9ac2c6;
  --teal-400: #6da2a9;
  --teal-600: #436e77;
  --teal-800: #374d53;
  --teal-900: #314248;
  --teal-950: #1d2a2f;
  --green-300: #afd87e;
  --green-400: #8fc552;
  --green-500: #72ab37;
  --green-950: #18270c;
  --ink: #0c1416;

  --glow-green: 0 0 0.08em rgba(175, 216, 126, 0.9), 0 0 0.35em rgba(143, 197, 82, 0.55), 0 0 0.9em rgba(114, 171, 55, 0.35);
  --glow-teal: 0 0 0.08em rgba(154, 194, 198, 0.8), 0 0 0.4em rgba(109, 162, 169, 0.45);

  --font-sans: "Proxima Nova", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--teal-100);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.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;
}

/* ---------- Backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(67, 110, 119, 0.45), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(24, 39, 12, 0.9), transparent 70%),
    linear-gradient(180deg, var(--teal-950) 0%, var(--ink) 55%, #070c0d 100%);
}

.backdrop-grid {
  position: absolute;
  inset: -50% -10% 0;
  background-image:
    linear-gradient(rgba(154, 194, 198, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 194, 198, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(55deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 70%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 70%, #000 20%, transparent 75%);
  animation: grid-scroll 6s linear infinite;
}

.orb {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.orb-green {
  background: var(--green-500);
  top: -18vmax;
  left: -14vmax;
  animation: drift-a 22s ease-in-out infinite alternate;
}

.orb-teal {
  background: var(--teal-600);
  bottom: -20vmax;
  right: -16vmax;
  animation: drift-b 26s ease-in-out infinite alternate;
}

/* ---------- Layout ---------- */

.stage {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 7rem) 16px 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Hero ---------- */

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--teal-300);
}

.eyebrow span {
  color: var(--green-300);
  text-shadow: var(--glow-green);
}

.title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 8.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, var(--teal-50) 15%, var(--teal-200) 60%, var(--teal-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.04em 0.12em rgba(0, 0, 0, 0.5));
}

.subtitle {
  margin: 0.15em 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2rem, 6.5vw, 4.75rem);
  line-height: 1.1;
  color: var(--green-300);
  text-shadow: var(--glow-green);
  animation: breathe 4.5s ease-in-out infinite;
}

/* ---------- Countdown ---------- */

.countdown {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lede {
  max-width: 40rem;
  text-wrap: balance;
  margin: 0 0 2rem;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--teal-200);
}

.clock {
  --clock-size: clamp(1.6rem, 7.2vw, 5.25rem);
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0 0.12em;
  padding: 0.35em 0.45em 0.3em;
  max-width: 100%;
  font-size: var(--clock-size);
  background:
    linear-gradient(180deg, rgba(29, 42, 47, 0.85), rgba(7, 12, 13, 0.92));
  border: 1px solid rgba(154, 194, 198, 0.16);
  border-radius: 0.22em;
  box-shadow:
    inset 0 0 0.6em rgba(0, 0, 0, 0.8),
    0 0.3em 1.2em rgba(0, 0, 0, 0.45),
    0 0 1.5em rgba(114, 171, 55, 0.08);
  overflow: hidden;
}

/* CRT scanlines over the panel */
.clock::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 4px);
  mix-blend-mode: multiply;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.digits {
  position: relative;
  display: inline-block;
  font-family: "DSEG7", monospace;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ghost {
  color: rgba(175, 216, 126, 0.07);
}

.lit {
  position: absolute;
  inset: 0;
  color: var(--green-300);
  text-shadow: var(--glow-green);
}

.unit-unknown .digits {
  font-family: "DSEG14", monospace;
}

.unit-unknown .ghost {
  color: rgba(154, 194, 198, 0.07);
}

.unit-unknown .lit {
  color: var(--teal-300);
  text-shadow: var(--glow-teal);
  animation: blink 1.2s steps(1, end) infinite;
}

.colon {
  font-family: "DSEG7", monospace;
  font-weight: 700;
  line-height: 1;
  color: var(--green-400);
  text-shadow: var(--glow-green);
  opacity: 0.85;
}

.label {
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: clamp(0.55rem, 1.3vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--teal-400);
}

/* Flash layer for the moment the clock hits zero. It sits above the panel's
   opaque gradient (animating background-color underneath would not show). */
.clock::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(175, 216, 126, 0.45);
  mix-blend-mode: screen;
  opacity: 0;
}

.clock.is-zero::before {
  animation: zero-flash 0.25s steps(2, end) 6;
}

.fineprint {
  max-width: 34rem;
  text-wrap: balance;
  margin: 1.5rem 0 0;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--teal-400);
}

/* ---------- Footer ---------- */

.footer {
  width: 100%;
  padding: 2.5rem 16px 2rem;
  border-top: 1px solid rgba(154, 194, 198, 0.12);
  background: linear-gradient(180deg, transparent, rgba(7, 12, 13, 0.7));
  text-align: center;
}

.cta {
  max-width: 44rem;
  text-wrap: balance;
  margin: 0 auto;
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  color: var(--teal-200);
}

.cta strong {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--teal-50);
}

.cta-action {
  display: block;
  margin-top: 0.9rem;
  font-weight: 600;
  color: var(--teal-100);
}

.cta a {
  display: inline-block;
  margin-left: 0.25em;
  padding: 0.35em 0.95em;
  border: 1px solid var(--green-400);
  border-radius: 999px;
  color: var(--green-300);
  text-decoration: none;
  box-shadow: 0 0 0.9em rgba(143, 197, 82, 0.25), inset 0 0 0.6em rgba(143, 197, 82, 0.12);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.cta a:hover,
.cta a:focus-visible {
  background: var(--green-400);
  color: var(--green-950);
  box-shadow: 0 0 1.4em rgba(143, 197, 82, 0.55);
  outline: none;
}

.copyright {
  margin: 1.75rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--teal-600);
}

/* ---------- Narrow screens: ??:?? on top, DD:HH:MM:SS below ---------- */

@media (max-width: 720px) {
  .clock {
    /* bottom row = 8 digits + 3 colons + gaps + panel padding, about 9.2em */
    --clock-size: clamp(1.25rem, calc((100vw - 2.5rem) / 9.4), 4.5rem);
    flex-wrap: wrap;
    row-gap: 0.25em;
  }

  .colon-wrap {
    flex-basis: 100%;
    height: 0;
    overflow: hidden;
  }
}

/* ---------- Motion ---------- */

@keyframes breathe {
  0%, 100% { text-shadow: var(--glow-green); }
  50% { text-shadow: 0 0 0.05em rgba(175, 216, 126, 0.7), 0 0 0.2em rgba(143, 197, 82, 0.35); }
}

@keyframes blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.25; }
}

@keyframes zero-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes grid-scroll {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 56px, 0 0; }
}

@keyframes drift-a {
  to { transform: translate(12vmax, 8vmax) scale(1.1); }
}

@keyframes drift-b {
  to { transform: translate(-10vmax, -6vmax) scale(1.15); }
}

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