/* ==========================================================================
   Oclasp — coming soon
   Concept: "The Seam" — a machined edge catching a single travelling light.
   Every value lives here as a token. No hardcoded colours below :root.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — self-hosted so the critical path is one hop, not a cross-origin chain.
   Fraunces (OFL) and JetBrains Mono (OFL) from Google Fonts; Switzer from
   Fontshare. JetBrains Mono is a text= subset: A-Z a-z 0-9 . , : / @ - and the
   middot. Widen it if mono copy ever needs another character.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 380 420;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-subset.woff2") format("woff2");
  unicode-range: U+20, U+2C-3A, U+40-5A, U+61-7A, U+B7;
}
@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/switzer-400.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/switzer-500.woff2") format("woff2");
}

:root {
  /* --- surface ---------------------------------------------------------- */
  --bg:        #0A0A0C;   /* obsidian, cool neutral, never pure black */
  --surface:   #131318;   /* input fields, subtle cards */
  --text:      #ECEDEF;   /* primary text, cool bone white, never pure white */
  --muted:     #8E9099;   /* secondary text, placeholder, footer */
  --line:      #23242A;   /* hairline borders, the seam at rest */

  /* --- the glint: one light source, three stops ------------------------- */
  --glint-1:   #8FA8C4;   /* cold steel, leading fringe */
  --glint-2:   #F2F4F8;   /* specular core */
  --glint-3:   #C9A87C;   /* brass, trailing fringe, used sparingly */

  /* Text glint: mostly --text, with a narrow travelling band of light.
     Sits behind the word "Oclasp" and is clipped to the letterforms. */
  --glint-text: linear-gradient(100deg,
    var(--text)    0%,   var(--text)   36%,
    var(--glint-1) 43%,
    var(--glint-2) 50%,
    var(--glint-3) 55%,
    var(--text)    62%,  var(--text)  100%);

  /* Edge glint: the full band, for 1px borders and focus rings. */
  --glint-edge: linear-gradient(100deg,
    var(--glint-1) 0%,
    var(--glint-2) 48%,
    var(--glint-3) 66%,
    var(--glint-1) 100%);

  /* --- type ------------------------------------------------------------- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Switzer", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --size-display: clamp(3rem, 7vw, 5.5rem);
  --size-subline: 1.125rem;
  --size-eyebrow: 0.75rem;
  --size-ui:      0.9375rem;

  --lh-display: 1.05;
  --lh-body:    1.6;
  --track-mono: 0.18em;

  /* --- space & shape ---------------------------------------------------- */
  --gutter:  clamp(1.5rem, 5vw, 4rem);
  --pad-y:   clamp(1.5rem, 4vh, 2.5rem);
  --radius:  10px;

  /* --- motion ----------------------------------------------------------- */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --dur-enter:  600ms;
  --dur-micro:  200ms;
  --dur-sweep:  16s;    /* the travelling glint */
  --dur-bloom:  1200ms; /* glint fades up after the headline lands */
}

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

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

/* A class that sets `display` outranks the UA stylesheet's [hidden] rule, so
   `el.hidden = true` silently does nothing. Make the attribute authoritative. */
[hidden] { display: none !important; }

body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-ui);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
input, button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Brushed grain — anisotropic, so the surface reads machined not mineral
   -------------------------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85 0.016' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Frame
   -------------------------------------------------------------------------- */
.frame {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-main,
.site-footer {
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: var(--pad-y);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-variation-settings: "opsz" 24, "wght" 420, "SOFT" 20;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.clasp-mark {
  width: 20px;
  height: auto;
  flex: none;
  transform: translateY(-0.06em);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: var(--size-eyebrow);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur-micro) ease;
}
.nav-link:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   The seam — one hairline across the full width, with light travelling it
   -------------------------------------------------------------------------- */
.seam {
  position: relative;
  height: 1px;
  background-color: var(--line);
  overflow: hidden;
}

.seam-glint {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 34%;
  background-image: linear-gradient(90deg,
    transparent 0%,
    var(--glint-1) 30%,
    var(--glint-2) 50%,
    var(--glint-3) 62%,
    transparent 100%);
  opacity: 0;
  animation:
    seam-travel var(--dur-sweep) linear infinite,
    bloom var(--dur-bloom) var(--ease-out) 720ms forwards;
}

@keyframes seam-travel {
  from { transform: translateX(-100%); }
  to   { transform: translateX(400%); } /* own width 34% of seam: 100/34 + 1 ≈ 394% */
}

@keyframes bloom {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Main stack
   -------------------------------------------------------------------------- */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  text-align: center;
  padding-block: clamp(3rem, 10vh, 6rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--size-eyebrow);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 20;
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-wrap: balance;
}

/* The travelling light, clipped to the brand word */
.glint {
  background-image: var(--glint-text);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: text-travel var(--dur-sweep) linear infinite;
}

/* No background-clip support: fall back to plain text, never invisible */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .glint { color: var(--text); -webkit-text-fill-color: var(--text); background-image: none; }
}

@keyframes text-travel {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}

.subline {
  font-size: var(--size-subline);
  line-height: var(--lh-body);
  color: var(--muted);
  max-width: 46ch;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Signup
   -------------------------------------------------------------------------- */
.signup {
  width: 100%;
  max-width: 30rem;
  margin-top: 0.75rem;
}

.form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.field { flex: 1; border-radius: var(--radius); }

.field input {
  width: 100%;
  height: 3rem;
  padding-inline: 1rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--dur-micro) ease;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; border-color: transparent; }
.field:has(input:focus-visible)::after { opacity: 1; }

.button {
  height: 3rem;
  padding-inline: 1.375rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-micro) ease, transform var(--dur-micro) var(--ease-out);
}
.button:hover { background-color: color-mix(in srgb, var(--surface) 82%, var(--text)); }
.button:hover::after { opacity: 1; }
.button:active { transform: translateY(1px); }

/* Shared 1px gradient edge, used by the button hover and the input focus ring */
.glint-edge { position: relative; }
.glint-edge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background-image: var(--glint-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-micro) ease;
  pointer-events: none;
}

.form-error,
.form-success {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.form-error { color: var(--glint-3); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: var(--pad-y);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.footer-links a {
  text-decoration: none;
  transition: color var(--dur-micro) ease;
}
.footer-links a:hover { color: var(--text); }
.dot { color: color-mix(in srgb, var(--muted) 50%, var(--bg)); }

/* Copy-to-clipboard fallback for the address. Hidden until JS confirms the
   clipboard API is available, so it never renders as a dead control. */
.copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  margin-left: -0.1rem;
  cursor: pointer;
  transition: color var(--dur-micro) ease;
}
.copy:hover { color: var(--text); }
.copy[data-copied] { color: var(--glint-1); }

.year {
  font-family: var(--font-mono);
  font-size: var(--size-eyebrow);
  letter-spacing: var(--track-mono);
}

/* --------------------------------------------------------------------------
   Focus — always visible, never removed
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--glint-1);
  outline-offset: 3px;
  border-radius: 4px;
}
.field input:focus-visible { outline: none; }
.field.glint-edge::after { padding: 2px; }

/* --------------------------------------------------------------------------
   Entrance — one orchestrated sequence, runs once
   -------------------------------------------------------------------------- */
[data-enter] {
  opacity: 0;
  animation: rise var(--dur-enter) var(--ease-out) forwards;
}
[data-enter="0"] { animation-delay:   0ms; }
[data-enter="1"] { animation-delay: 120ms; }
[data-enter="2"] { animation-delay: 240ms; }
[data-enter="3"] { animation-delay: 360ms; }
[data-enter="4"] { animation-delay: 480ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 34rem) {
  :root { --pad-y: 1.25rem; }
  .site-main { padding-block: 2rem; gap: 1.25rem; }
  .form { flex-direction: column; }
  .button { width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .display { max-width: 100%; }
}

/* Short viewports: keep the whole stack inside one screen */
@media (max-height: 44rem) {
  .site-main { padding-block: 1.5rem; gap: 1rem; }
}

/* --------------------------------------------------------------------------
   Reduced motion — no rise, no travel. Light renders static, opacity only.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  [data-enter] {
    animation: fade-only var(--dur-enter) ease forwards;
  }
  @keyframes fade-only {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .glint {
    animation: none;
    background-position: 46% 0;
  }

  .seam-glint {
    animation: bloom var(--dur-bloom) ease 300ms forwards;
    transform: translateX(28%);
  }

  .button:active { transform: none; }
}
