/* ==========================================================================
   HEK Ventures – Landingpage
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="dark"] {
  --bg: #070707;
  --bg-2: #121212;
  --fg: #f4f4f2;
  --fg-soft: rgba(244, 244, 242, 0.72);
  --fg-mute: rgba(244, 244, 242, 0.42);
  --line: rgba(244, 244, 242, 0.18);
  --dot: rgba(244, 244, 242, 0.45);
  --grain-opacity: 0.06;
  --selection: rgba(244, 244, 242, 0.9);
  --selection-fg: #070707;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f5f3;
  --bg-2: #ffffff;
  --fg: #0d0d0c;
  --fg-soft: rgba(13, 13, 12, 0.74);
  --fg-mute: rgba(13, 13, 12, 0.45);
  --line: rgba(13, 13, 12, 0.2);
  --dot: rgba(13, 13, 12, 0.35);
  --grain-opacity: 0.045;
  --selection: #0d0d0c;
  --selection-fg: #f5f5f3;
  color-scheme: light;
}

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease-in-out), color 0.6s var(--ease-in-out);
}

::selection {
  background: var(--selection);
  color: var(--selection-fg);
}

a {
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
}

/* --- Atmosphere ----------------------------------------------------------- */

.bg-silk {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: fade-in 2.4s var(--ease-out) 0.1s forwards;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 48%, transparent 0%, transparent 55%, var(--bg) 135%);
  opacity: 0.85;
}

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}

/* --- Shell ---------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3vw, 32px) var(--gutter);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.topbar {
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 1.9s forwards;
}

.footer {
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 2.1s forwards;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg-soft);
}

.topbar__brand svg {
  height: 14px;
  width: auto;
  display: block;
}

.topbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pulse {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-soft);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--fg-soft);
  animation: pulse 2.4s var(--ease-out) infinite;
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
}

.link {
  position: relative;
  text-decoration: none;
  color: var(--fg-mute);
  transition: color 0.3s ease;
  padding: 6px 0;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.link:hover,
.link:focus-visible {
  color: var(--fg);
}
.link:hover::after,
.link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -8px -8px -8px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  transition: color 0.3s ease, transform 0.6s var(--ease-out);
}
.theme-toggle:hover {
  color: var(--fg);
  transform: rotate(45deg);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}
.theme-toggle .half {
  transition: transform 0.6s var(--ease-out);
  transform-origin: center;
  transform-box: fill-box;
}
:root[data-theme="light"] .theme-toggle .half {
  transform: rotate(180deg);
}

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

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px var(--gutter) 40px;
}

.hero__logo {
  width: clamp(250px, 36vw, 540px);
  height: auto;
  display: block;
  overflow: visible;
  color: var(--fg);
}

.hero__logo .logo-rule {
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0);
  animation: rule-grow 1.1s var(--ease-in-out) 0.25s forwards;
}

.hero__logo .logo-mark {
  opacity: 0;
  transform: translateX(-14px);
  animation: slide-in 1.3s var(--ease-out) 0.9s forwards;
}

.hero__logo .logo-word {
  opacity: 0;
  transform: translateX(14px);
  animation: slide-in 1.3s var(--ease-out) 1.05s forwards;
}

.hero__tagline {
  margin: clamp(28px, 4.2vw, 56px) 0 0;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--fg);
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  animation: reveal 1.4s var(--ease-out) 1.45s forwards;
}

.hero__rule {
  width: 80px;
  height: 1px;
  margin: clamp(26px, 3.4vw, 44px) auto;
  border: 0;
  background: var(--line);
  transform: scaleX(0);
  animation: rule-x 1s var(--ease-in-out) 1.75s forwards;
}

.pillars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 clamp(18px, 3vw, 44px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(13px, 1.25vw, 18px);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fg);
}

.pillars li {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 1s var(--ease-out) forwards;
}
.pillars li:nth-child(1) { animation-delay: 1.95s; }
.pillars li:nth-child(2) { animation-delay: 2.08s; }
.pillars li:nth-child(3) { animation-delay: 2.21s; }

/* tracking adds trailing space after the last letter – compensate */
.pillars li span {
  margin-right: -0.34em;
}

.pillars li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.contact {
  margin-top: clamp(48px, 6.5vw, 96px);
  opacity: 0;
  animation: fade-in 1.2s var(--ease-out) 2.45s forwards;
}

.contact__label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.contact__mail {
  position: relative;
  display: inline-block;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--fg);
  padding-bottom: 4px;
}
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transform: scaleX(0.2);
  transition: transform 0.6s var(--ease-out), opacity 0.6s ease;
}
.contact__mail:hover::after,
.contact__mail:focus-visible::after {
  transform: scaleX(1);
  opacity: 1;
}

.footer__links {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
}

/* --- Legal pages ---------------------------------------------------------- */

.page-legal .bg-silk {
  animation: fade-in-dim 2s var(--ease-out) forwards;
}

.page-legal .topbar,
.page-legal .footer {
  animation-delay: 0.1s;
}

.legal {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 7vw, 96px) var(--gutter) clamp(48px, 8vw, 120px);
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 1s var(--ease-out) 0.15s forwards;
}

.legal__eyebrow {
  display: block;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.legal h1 {
  margin: 0 0 clamp(36px, 5vw, 64px);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.legal h2 {
  margin: clamp(40px, 5vw, 56px) 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg);
}

.legal h3 {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}

.legal p,
.legal li,
.legal address {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--fg-soft);
  font-style: normal;
  hyphens: auto;
  overflow-wrap: break-word;
}

.legal p {
  margin: 0 0 14px;
}

.legal ul {
  margin: 0 0 14px;
  padding-left: 1.1em;
}

.legal strong {
  font-weight: 500;
  color: var(--fg);
}

.legal a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.3s ease;
}
.legal a:hover {
  text-decoration-color: currentColor;
}

.legal .note {
  margin-top: 56px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
}

/* --- 404 ------------------------------------------------------------------ */

.notfound h1 {
  margin: 0;
  font-size: clamp(96px, 18vw, 240px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.06em;
}

/* --- Keyframes ------------------------------------------------------------ */

@keyframes fade-in {
  to { opacity: 1; }
}
@keyframes fade-in-dim {
  to { opacity: 0.55; }
}
@keyframes slide-in {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes rule-grow {
  to { transform: scaleY(1); }
}
@keyframes rule-x {
  to { transform: scaleX(1); }
}
@keyframes reveal {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 640px) {
  .topbar__meta { display: none; }
  .footer {
    flex-direction: column-reverse;
    gap: 10px;
    text-align: center;
  }
  .pillars {
    gap: 0 14px;
    letter-spacing: 0.26em;
  }
  .pillars li { gap: 14px; }
  .pillars li span { margin-right: -0.26em; }
  .pillars li + li::before { width: 4px; height: 4px; }
}

@media (max-height: 560px) and (min-width: 641px) {
  .contact { margin-top: 32px; }
}

/* --- 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;
  }
  body::after { animation: none; }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  .bg-silk, .bg-vignette, body::after, .theme-toggle, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  * { opacity: 1 !important; transform: none !important; filter: none !important; }
}
