:root {
  --bg: #0b0c0e;
  --surface: #121317;
  --text: #e7e8ea;
  --muted: #9aa1a9;
  --card: #171921;
  --border: #22252e;
  --accent: #f59e0b; /* amber */
  --radius: 14px;
  /* Grid pattern controls */
  --grid: 48px;       /* spacing for vertical/horizontal lines */
  --stroke: 1.2px;    /* line thickness */
  --line: rgba(255,255,255,0.9); /* line color */
  /* Glass styles */
  --glass-bg: rgba(255,255,255,0.06);
  --glass-bg-2: rgba(255,255,255,0.02);
  --glass-border: rgba(255,255,255,0.14);
  --glass-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #0c0d0f;
    --muted: #4b5563;
    --card: #ffffff;
    --border: #e5e7eb;
    --glass-bg: rgba(255,255,255,0.55);
    --glass-bg-2: rgba(255,255,255,0.35);
    --glass-border: rgba(0,0,0,0.08);
    --glass-shadow: 0 10px 30px rgba(0,0,0,0.10);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  /* Layers: glow, line grids (V/H and diagonals), base color */
  background:
    radial-gradient(1200px 800px at 80% -10%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 70%),
    /* vertical lines */
    repeating-linear-gradient(
      to right,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    ),
    /* horizontal lines */
    repeating-linear-gradient(
      to bottom,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    ),
    /* +45° diagonals at every second grid interval */
    repeating-linear-gradient(
      45deg,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent calc(var(--grid) * 2)
    ),
    /* -45° diagonals at every second grid interval */
    repeating-linear-gradient(
      135deg,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent calc(var(--grid) * 2)
    ),
    var(--bg);
  background-repeat: no-repeat, repeat, repeat, repeat, repeat, no-repeat;
  /* Alignment: nudge diagonals by one grid to hit every other intersection */
  background-position:
    80% -10%,
    0 0,
    0 0,
    calc(var(--grid)) 0,
    0 calc(var(--grid)),
    0 0;
  background-size: auto, auto, auto, auto, auto, auto;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  position: relative;
  z-index: 1; /* ensure background lines sit beneath all content */
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0;
  border-radius: var(--radius);
  /* container only; children are glass panels */
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  inline-size: min(400px, 100%);
  justify-self: center;
}

.hero-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  padding: 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--glass-bg), var(--glass-bg-2));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.hero-text {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--glass-bg), var(--glass-bg-2));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.hero h1 {
  margin: 0;
  font-size: 1.9rem;
}

.hero .tagline {
  margin: 0;
}

/* Stack hero content on small screens */
@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; gap: 10px; }
  .hero-text { justify-items: center; text-align: center; }
  .hero-avatar { justify-self: center; }
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 0; /* remove accent outline */
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

h1 {
  font-size: 1.8rem;
  margin: 4px 0 2px;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.links {
  display: grid;
  gap: 14px;
}

.link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--glass-bg), var(--glass-bg-2));
  border: 1px solid var(--glass-border);
  color: inherit;
  text-decoration: none;
  transition: transform 140ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.link-card:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--glass-bg) 70%, white 10%),
    color-mix(in oklab, var(--glass-bg-2) 70%, white 5%)
  );
  border-color: color-mix(in oklab, var(--accent) 35%, var(--glass-border));
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
}

.link-card:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent) 40%, transparent);
  outline-offset: 2px;
}

.label {
  font-weight: 600;
}

.text {
  display: grid;
  gap: 6px;
}

.desc {
  color: var(--muted);
  line-height: 1.35;
}

.arrow {
  color: var(--muted);
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--glass-border) 70%, transparent);
  box-shadow: 0 1px 0 rgba(0,0,0,0.12) inset;
}

.footer {
  color: var(--muted);
  text-align: center;
}

@supports not (color: oklch(50% 0.2 30)) {
  /* Safe fallback if color-mix/oklab not supported */
  body { background: var(--bg); }
  .link-card { background: var(--card); border: 1px solid var(--border); box-shadow: 0 1px 0 rgba(0,0,0,0.08); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .link-card:hover { border-color: var(--accent); background: var(--card); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
  .link-card:focus-visible { outline-color: var(--accent); }
  .hero { background: var(--card); border: 1px solid var(--border); box-shadow: 0 1px 0 rgba(0,0,0,0.08); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Fallback when backdrop-filter unsupported */
@supports not ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))) {
  .link-card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  }
}

/* --- Pattern Staging Overrides --- */
:root {
  /* Grid pattern controls (stage 1) */
  --grid: 48px;        /* spacing for vertical lines */
  --stroke: 1.2px;     /* line thickness */
  --line: rgba(255,255,255,0.9); /* line color on dark */
  --diag: calc(var(--grid) * 2); /* spacing for 45° lines */
  --ray: 1.2deg;       /* angular width for conic ray lines */
  --wave: 8000vw;      /* width of one RGB color cycle (fat bands) */
  --seg: calc(var(--wave) / 7);
}

@media (prefers-color-scheme: light) {
  :root { --line: rgba(0,0,0,0.18); }
}

/* Override body background to solid dark */
body {
  background: var(--bg);
}

/* Stage 1: vertical lines that peek in from top */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to right,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    );
  /* Reveal from top to bottom */
  clip-path: inset(0 0 100% 0);
  animation: reveal-down 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}

@keyframes reveal-down {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* Stage 2: horizontal lines that peek in left -> right */
.bg-h {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    );
  /* Reveal from left to right */
  clip-path: inset(0 100% 0 0);
  animation: reveal-right 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}

@keyframes reveal-right {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* Stage 3: 45° lines from the top-left corner */
.bg-d {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Split top-left corner into 3 equal 30° sectors via lines at 30° and 60° */
  background:
    linear-gradient(
      30deg,
      transparent calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% + (var(--stroke) / 2)),
      transparent calc(50% + (var(--stroke) / 2))
    ),
    linear-gradient(
      60deg,
      transparent calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% + (var(--stroke) / 2)),
      transparent calc(50% + (var(--stroke) / 2))
    );
  background-size: var(--grid) var(--grid);
  background-repeat: repeat;
  background-position: 0 0;
  /* Reveal outward from the top-left corner */
  clip-path: inset(0 100% 100% 0);
  animation: reveal-topleft 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}

@keyframes reveal-topleft {
  from { clip-path: inset(0 100% 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* Stage 4: 135° lines from the top-right corner (perpendicular to Stage 3) */
.bg-d2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Split top-right corner into 3 equal 30° sectors via lines at 120° and 150° */
  background:
    linear-gradient(
      120deg,
      transparent calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% + (var(--stroke) / 2)),
      transparent calc(50% + (var(--stroke) / 2))
    ),
    linear-gradient(
      150deg,
      transparent calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% - (var(--stroke) / 2)),
      var(--line) calc(50% + (var(--stroke) / 2)),
      transparent calc(50% + (var(--stroke) / 2))
    );
  background-size: var(--grid) var(--grid);
  background-repeat: repeat;
  background-position: 0 0;
  /* Reveal from the top-right corner */
  clip-path: inset(0 0 100% 100%);
  animation: reveal-topright 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}

@keyframes reveal-topright {
  from { clip-path: inset(0 0 100% 100%); }
  to   { clip-path: inset(0 0 0 0); }
}

/* RGB keyboard-style wave colorizer */
.rgb {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Razer-style keyboard wave colors */
  background: linear-gradient(90deg,
    #ff0000 0%,
    #ff7a00 12.5%,
    #ffff00 25%,
    #00ff00 37.5%,
    #00ffff 50%,
    #0066ff 62.5%,
    #7a00ff 75%,
    #ff00ff 87.5%,
    #ff0000 100%
  );
  background-size: var(--wave) 100%;
  background-repeat: repeat;
  animation: rgb-wave 60s linear infinite;
  opacity: 0.75;
}

/* OKLCH optional: comment out to keep exact brand-like hues */

@keyframes rgb-wave {
  0% { background-position: 0 50%; }
  100% { background-position: var(--wave) 50%; }
}

/* removed hue-cycle */
}

/* Use CSS masks so gradient only shows where lines are */
.rgb-v {
  -webkit-mask-image: repeating-linear-gradient(to right, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
          mask-image: repeating-linear-gradient(to right, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  -webkit-mask-position: 0 0;
          mask-position: 0 0;
  /* reveal same as Stage 1 */
  clip-path: inset(0 0 100% 0);
  animation-name: rgb-wave, reveal-down;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

.rgb-h {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
          mask-image: repeating-linear-gradient(to bottom, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  -webkit-mask-position: 0 0;
          mask-position: 0 0;
  /* reveal same as Stage 2 */
  clip-path: inset(0 100% 0 0);
  animation-name: rgb-wave, reveal-right;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

.rgb-v2 {
  -webkit-mask-image: repeating-linear-gradient(to right, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
          mask-image: repeating-linear-gradient(to right, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  -webkit-mask-position: calc(var(--grid)/2) 0;
          mask-position: calc(var(--grid)/2) 0;
  /* reveal same as Stage 5 */
  clip-path: inset(0 0 100% 0);
  animation-name: rgb-wave, reveal-down;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

.rgb-h2 {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
          mask-image: repeating-linear-gradient(to bottom, #000 0 var(--stroke), transparent var(--stroke) var(--grid));
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  -webkit-mask-position: 0 calc(var(--grid)/2);
          mask-position: 0 calc(var(--grid)/2);
  /* reveal same as Stage 6 */
  clip-path: inset(0 100% 0 0);
  animation-name: rgb-wave, reveal-right;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

.rgb-d {
  -webkit-mask-image:
      linear-gradient(30deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2))),
      linear-gradient(60deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2)));
          mask-image:
      linear-gradient(30deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2))),
      linear-gradient(60deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2)));
  -webkit-mask-size: var(--grid) var(--grid);
          mask-size: var(--grid) var(--grid);
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  /* reveal same as Stage 3 */
  clip-path: inset(0 100% 100% 0);
  animation-name: rgb-wave, reveal-topleft;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

.rgb-d2 {
  -webkit-mask-image:
      linear-gradient(120deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2))),
      linear-gradient(150deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2)));
          mask-image:
      linear-gradient(120deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2))),
      linear-gradient(150deg, transparent calc(50% - (var(--stroke)/2)), #000 calc(50% - (var(--stroke)/2)), #000 calc(50% + (var(--stroke)/2)), transparent calc(50% + (var(--stroke)/2)));
  -webkit-mask-size: var(--grid) var(--grid);
          mask-size: var(--grid) var(--grid);
  -webkit-mask-repeat: repeat;
          mask-repeat: repeat;
  /* reveal same as Stage 4 */
  clip-path: inset(0 0 100% 100%);
  animation-name: rgb-wave, reveal-topright;
  animation-duration: 60s, 1400ms;
  animation-timing-function: linear, cubic-bezier(.22,.7,.18,1);
  animation-iteration-count: infinite, 1;
  animation-fill-mode: none, forwards;
}

/* Show base monochrome layers so background stays black */
.bg, .bg-h, .bg-d, .bg-d2, .bg-v2, .bg-h2 { opacity: 1; }

/* Enable RGB overlays */
.rgb { display: block; mix-blend-mode: color; opacity: 1; }

/* If CSS masks aren’t supported, disable color overlays to keep black background */
@supports not (mask-image: linear-gradient(#000, transparent)) {
  .rgb { display: none !important; }
}

/* Stage 5: second set of vertical lines, halfway between Stage 1 lines */
.bg-v2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to right,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    );
  /* shift by half-grid to fall between existing verticals */
  background-position: calc(var(--grid) / 2) 0;
  /* Reveal from top to bottom */
  clip-path: inset(0 0 100% 0);
  animation: reveal-down 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}

/* Stage 6: second set of horizontal lines, halfway between Stage 2 lines */
.bg-h2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--line) 0,
      var(--line) var(--stroke),
      transparent var(--stroke),
      transparent var(--grid)
    );
  /* shift by half-grid to fall between existing horizontals */
  background-position: 0 calc(var(--grid) / 2);
  /* Reveal from left to right */
  clip-path: inset(0 100% 0 0);
  animation: reveal-right 1400ms cubic-bezier(.22,.7,.18,1) forwards;
}



