/* ============================================================
   REMUDA GROUP AB — static landing page
   Warm dark monochrome / minimalist investor-relations.
   One locked dark theme. One earthen accent. Type does the work.
   ============================================================ */

/* ------------------------------------------------------------
   Self-hosted type (latin subset, from Google Fonts under OFL).
   Served from our own origin rather than fonts.gstatic.com: it
   removes a third-party DNS + TLS round trip before first paint,
   and keeps visitor IP addresses from reaching a US ad company,
   which matters for an EU site.
   ------------------------------------------------------------ */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;      /* variable weight axis  */
  font-stretch: 100% 125%;   /* variable width axis   */
  font-display: swap;
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  /* ---- Surfaces & text (warm near-black family, never #000/#FFF) ---- */
  --bg:          #0B0A09;   /* warm near-black canvas */
  --bg-raise:    #12100E;   /* barely-raised surface */
  --text:        #ECE9E4;   /* warm off-white */
  --text-dim:    #8F8A82;   /* secondary — passes AA on --bg */
  --text-faint:  #625D55;   /* tertiary / decorative only */

  /* ---- Lines (structure comes from hairlines, never shadows) ---- */
  --line:        #201D19;   /* primary hairline */
  --line-bright: rgba(236, 233, 228, 0.22); /* the horizon rule */

  /* ---- The single earthen accent — desaturated rust, used < 5 times ---- */
  --accent:      #C87F4F;
  --accent-deep: #7A4A2B;

  /* ---- Type ---- */
  --font-display: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Layout ---- */
  --maxw:   1180px;
  --gutter: clamp(1.5rem, 6vw, 6rem);

  /* ---- Whitespace scale (8px base) ---- */
  --s1: .5rem;  --s2: 1rem;  --s3: 2rem;
  --s4: 4rem;   --s5: 8rem;

  /* ---- Easing ---- */
  --ease:      cubic-bezier(.22, .61, .36, 1);   /* strong ease-out */
  --ease-rule: cubic-bezier(.77, 0, .175, 1);    /* the horizon draw */
  --ease-io:   cubic-bezier(.4, 0, .2, 1);       /* symmetric state change */
}

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

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2 { font-weight: 500; line-height: 1; }

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

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

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

/* ---------------------------------------------------------- */
/* Film grain — fixed overlay, static SVG noise, no repaints   */
/* ---------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='128'%20height='128'%20filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ---------------------------------------------------------- */
/* Layout shell                                                */
/* ---------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--gutter);
  z-index: 100;
  padding: .65rem 1rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.skip-link:focus-visible { top: .75rem; outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------- */
/* Header                                                      */
/* ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease-io), background-color .35s var(--ease-io);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(3.75rem, 7vh, 4.75rem);
}

.lockup {
  font-family: var(--font-mono);
  font-size: clamp(.66rem, .8vw, .75rem);
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--text-dim);
  white-space: nowrap;
}
.lockup-sep { margin-inline: .55em; color: var(--text-dim); }
.lockup-sub { color: var(--text-dim); }

/* Language toggle */
.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .15rem;
}
.lang-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;                   /* >=44px tap target, both axes */
  min-height: 44px;
  padding: 0 .3rem;
  font-family: var(--font-mono);
  font-size: clamp(.66rem, .8vw, .75rem);
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--text-dim);            /* inactive — passes AA on --bg */
  cursor: pointer;
  transition: color .2s var(--ease-io);
}
.lang-opt:hover { color: var(--text); }
.lang-opt.is-active { color: var(--text); }
.lang-sep { color: var(--text-dim); font-family: var(--font-mono); font-size: .7rem; }
.lang-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }

/* The active language is marked in CSS, not JS: each language is its own
   URL now, so the state is known at render time. */
.lang-opt.is-active::after {
  content: "";
  position: absolute;
  left: .3rem;
  /* letter-spacing leaves a trailing gap after the last glyph; inset the same
     amount on the right so the rule sits under the text, not past it. */
  right: calc(.3rem + .18em);
  bottom: .8rem;
  height: 1px;
  background: var(--accent);
  pointer-events: none;
}

/* ---------------------------------------------------------- */
/* Hero                                                        */
/* ---------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding-block: clamp(6rem, 14vh, 9rem) clamp(4rem, 10vh, 7rem);
}

.wordmark {
  font-family: var(--font-display);
  font-stretch: 125%;                /* the expanded cut IS the wordmark */
  font-weight: 600;
  font-size: clamp(2.9rem, 13vw, 10.5rem);
  line-height: .95;
  letter-spacing: clamp(.03em, .4vw, .08em);
  color: var(--text);
  white-space: nowrap;
}
.wm-letter { display: inline-block; }
.wm-letter:last-child { letter-spacing: 0; }  /* no trailing tracking gap */

/* Full-bleed horizon rule between wordmark and statement */
.horizon {
  display: block;
  width: 100%;
  height: 1px;
  margin-block: clamp(2rem, 5vh, 3.5rem);
  background: var(--line-bright);
  transform-origin: left center;
}

.hero-lower { display: flex; }

.hero-statement {
  max-width: 34ch;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.005em;
  color: var(--text);
  text-wrap: balance;
}

/* On wider screens the statement sits against the right edge,
   in tension with the left-set wordmark above the horizon. */
@media (min-width: 720px) {
  .hero-statement { margin-left: auto; }
}

/* ---------------------------------------------------------- */
/* Section header pattern (label + hairline)                   */
/* ---------------------------------------------------------- */
.site-footer { padding-block: clamp(6rem, 15vh, 12rem); }
.site-footer { padding-bottom: clamp(3rem, 8vh, 5rem); }

.section-head {
  display: flex;
  align-items: baseline;
  padding-bottom: clamp(2rem, 4vh, 3rem);
  border-bottom: 1px solid var(--line);
}
.section-label {
  font-family: var(--font-mono);
  font-size: clamp(.7rem, .9vw, .8rem);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------------------------------------------------------- */
/* Footer                                                      */
/* ---------------------------------------------------------- */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: end;
  padding-block: clamp(3rem, 8vh, 6rem) clamp(3rem, 7vh, 5rem);
}

.footer-contact { display: flex; flex-direction: column; min-width: 0; }
.email {
  position: relative;
  align-self: flex-start;
  max-width: 100%;
  overflow-wrap: anywhere;           /* never clip the address on a 320px phone */
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--text);
  transition: color .2s var(--ease-io);
}
.email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.1em;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease);
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.85;
  color: var(--text-dim);
  text-align: right;
}

.copyright {
  padding-top: clamp(2rem, 5vh, 3rem);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--text-dim);
}

/* ---------------------------------------------------------- */
/* Hover affordances (pointer devices only)                    */
/* ---------------------------------------------------------- */
@media (hover: hover) {
  .email:hover { color: var(--text); }
  .email:hover::after { transform: scaleX(1); }
}
.email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 1px;
}
.email:active { color: var(--accent); }

/* ============================================================
   MOTION
   All entrance/hidden states are gated behind BOTH `html.js`
   and `prefers-reduced-motion: no-preference`, so the page is
   fully visible with JS disabled or reduced-motion enabled.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* Wordmark entrance — letters rise in one by one */
  html.js .wm-letter {
    opacity: 0;
    transform: translateY(.35em);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
  }
  html.js.is-ready .wm-letter { opacity: 1; transform: none; }

  /* The signature gesture — the horizon draws itself across the viewport */
  html.js .horizon {
    transform: scaleX(0);
    transition: transform .9s var(--ease-rule) 260ms;
    will-change: transform;
  }
  html.js.is-ready .horizon { transform: scaleX(1); }

  /* Statement fade + rise, after the horizon has landed */
  html.js .hero-anim {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .72s var(--ease), transform .72s var(--ease);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
  }
  html.js.is-ready .hero-anim { opacity: 1; transform: none; }

  /* Scroll-reveal — one-shot, staggered via --i */
  html.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .56s var(--ease), transform .56s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  html.js .reveal.is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   RESPONSIVE  — re-rag the layout, don't just shrink it.
   ============================================================ */

/* iPad / tablet */
@media (max-width: 900px) {
  .footer-legal { line-height: 1.9; }
}

/* Small tablet → phone */
@media (max-width: 680px) {
  .footer-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: clamp(2.5rem, 8vh, 3.5rem);
  }
  .footer-legal { text-align: left; }
}

/* Phone */
@media (max-width: 520px) {
  .wordmark { letter-spacing: .02em; }
  .hero { padding-block: clamp(5rem, 12vh, 7rem) clamp(3rem, 8vh, 5rem); }
}
