/* =============================================================
   HefTek — styles.css
   Black & silver. Cormorant Garamond display. Minimalist.
   One page, one statement.
   ============================================================= */

:root {
  --void:          #060608;
  --void-2:        #0c0c10;

  /* silver scale */
  --silver-hi:     #f0eff2;
  --silver-mid:    #a8adb8;
  --silver-dim:    #55586a;
  --silver-ghost:  #2a2c35;

  /* borders & glass */
  --border:        rgba(255, 255, 255, 0.07);
  --border-hi:     rgba(255, 255, 255, 0.14);

  /* type */
  --font-display:  "Cormorant Garamond", Georgia, serif;
  --font-body:     "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, monospace;

  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --safe-b:        env(safe-area-inset-bottom, 0px);
  --safe-l:        env(safe-area-inset-left, 0px);
  --safe-r:        env(safe-area-inset-right, 0px);
}

/* ------------------------------------------------------------- reset */

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

html,
body {
  height: 100%;
}

html {
  overflow-x: hidden;
  color-scheme: dark;
}

body {
  background: var(--void);
  color: var(--silver-hi);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-y: auto; /* safety net only — the layout is sized to avoid needing it */
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(240, 239, 242, 0.16);
  color: var(--silver-hi);
}

/* thin, themed scrollbar for the rare case content needs the fallback scroll */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--silver-ghost) var(--void);
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: var(--void);
}

body::-webkit-scrollbar-thumb {
  background: var(--silver-ghost);
  border-radius: 4px;
}

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

img {
  display: block;
}

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

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

/* ------------------------------------------------------------- grain texture */

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* subtle radial atmosphere — warm center, pure black edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 55% at 50% 42%,
    rgba(80, 82, 100, 0.10) 0%,
    transparent 70%
  );
}

/* ------------------------------------------------------------- stage */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(28px, 6vw, 40px) clamp(20px, 6vw, 32px) clamp(16px, 4vw, 24px);
}

/* ------------------------------------------------------------- logo mark */

.mark {
  margin-bottom: clamp(18px, 4vw, 28px);
  /* opacity starts at 0 — JS drives the flicker */
  opacity: 0;
  will-change: opacity;
  filter: drop-shadow(0 0 0px rgba(200, 205, 220, 0));
  transition: filter 0.6s var(--ease);
}

.mark.lit {
  filter: drop-shadow(0 0 22px rgba(180, 185, 210, 0.18));
}

.mark img {
  width: clamp(88px, 20vw, 160px);
  height: clamp(88px, 20vw, 160px);
}

/* ------------------------------------------------------------- wordmark */

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: 0.28em;
  padding-left: 0.28em; /* optical re-centre for tracked text */
  color: var(--silver-mid);
  margin-bottom: clamp(20px, 4vw, 36px);
}

/* ------------------------------------------------------------- headline */

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.1rem, 8vw, 5.2rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--silver-hi);
  margin-bottom: clamp(16px, 3vw, 28px);
}

h1 em {
  font-style: italic;
  font-weight: 300;
  /* silver gradient — logo accent repurposed as type treatment */
  background: linear-gradient(
    110deg,
    var(--silver-mid) 0%,
    var(--silver-hi)  40%,
    var(--silver-mid) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 8s ease-in-out infinite;
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ------------------------------------------------------------- sub */

.sub {
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 2.6vw, 1.05rem);
  font-weight: 300;
  color: var(--silver-dim);
  line-height: 1.7;
  max-width: 52ch;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(20px, 6vw, 32px) calc(18px + var(--safe-b));
  padding-left: calc(clamp(20px, 6vw, 32px) + var(--safe-l));
  padding-right: calc(clamp(20px, 6vw, 32px) + var(--safe-r));
  border-top: 1px solid var(--border);
}

.footer-domain,
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--silver-ghost);
}

.footer-meta {
  margin-left: auto;
}

.footer-contact {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--silver-mid);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.footer-contact:hover {
  color: var(--silver-hi);
  border-color: var(--silver-dim);
}

/* ------------------------------------------------------------- fade-in sequence */

[data-fade] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-fade].visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer[data-fade] {
  transform: none; /* footer never slides up, only fades */
}

.site-footer[data-fade].visible {
  transform: none;
}

/* ------------------------------------------------------------- logo flicker */

@keyframes flicker-logo {
  0%   { opacity: 0;    }
  6%   { opacity: 0.85; }
  8%   { opacity: 0;    }
  14%  { opacity: 0.9;  }
  16%  { opacity: 0;    }
  22%  { opacity: 0;    }
  26%  { opacity: 1;    }
  30%  { opacity: 0.15; }
  34%  { opacity: 1;    }
  40%  { opacity: 0.7;  }
  46%  { opacity: 1;    }
  54%  { opacity: 0.5;  }
  60%  { opacity: 1;    }
  70%  { opacity: 0.88; }
  80%  { opacity: 1;    }
  90%  { opacity: 0.95; }
  100% { opacity: 1;    }
}

.mark.flickering {
  animation: flicker-logo 1.9s var(--ease) forwards;
}

/* ------------------------------------------------------------- mobile */

@media (max-width: 600px) {
  .br-desk {
    display: none;
  }

  .site-footer {
    justify-content: center;
    text-align: center;
    gap: 8px 20px;
  }

  .footer-meta {
    margin: 0;
    width: 100%;
    text-align: center;
  }
}

/* short viewports (landscape phones) — tighten vertical rhythm rather
   than letting anything crowd the footer or need the scroll safety net. */
@media (max-height: 620px) {
  .mark img {
    width: clamp(64px, 14vw, 96px);
    height: clamp(64px, 14vw, 96px);
  }
  .mark {
    margin-bottom: 12px;
  }
  .wordmark {
    margin-bottom: 14px;
  }
  h1 {
    font-size: clamp(1.8rem, 7vw, 3rem);
    margin-bottom: 10px;
  }
  .sub br {
    display: none;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .mark {
    opacity: 1;
    animation: none !important;
  }
  [data-fade] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  h1 em {
    animation: none;
    background-position: 0% 50%;
  }
}
