:root {
  --bg: #050609;
  --ink: #f2efea;
  --muted: #968f85;        /* section labels */
  --muted-strong: #c4beb3; /* bio, top links */
  --meta: #cbc5ba;         /* right-column values / taglines */
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff7a45;
  --radius: 4px;
  --grain-opacity: 0.28;

  /* frosted glass panel */
  --glass-bg: rgba(9, 10, 15, 0.62);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hi: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Silky iridescent light-ribbon background ---------- */
/* Layer 1: vivid colour streaks blurred into a flowing silk wave */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -3;
  background:
    /* warm head — orange / red, lower left */
    radial-gradient(38% 26% at 16% 70%, rgba(255, 122, 48, 0.95) 0%, transparent 62%),
    radial-gradient(30% 22% at 8% 80%, rgba(226, 52, 74, 0.9) 0%, transparent 60%),
    radial-gradient(26% 18% at 26% 62%, rgba(214, 51, 108, 0.8) 0%, transparent 60%),
    /* electric core — blue sweeping centre */
    radial-gradient(46% 30% at 48% 80%, rgba(43, 108, 255, 0.85) 0%, transparent 64%),
    radial-gradient(40% 26% at 64% 70%, rgba(58, 140, 255, 0.8) 0%, transparent 62%),
    /* violet tail — right */
    radial-gradient(44% 30% at 86% 60%, rgba(91, 61, 245, 0.8) 0%, transparent 64%),
    radial-gradient(30% 22% at 96% 74%, rgba(150, 70, 255, 0.7) 0%, transparent 60%),
    /* faint cyan glint along the crest */
    radial-gradient(60% 8% at 50% 56%, rgba(120, 220, 255, 0.35) 0%, transparent 70%),
    /* dark base + vignette */
    radial-gradient(120% 90% at 50% 30%, #07080d 0%, #030409 70%),
    var(--bg);
  background-repeat: no-repeat;
  filter: blur(60px) saturate(1.25);
  will-change: transform;
  transform: translateZ(0);
  animation: drift 26s ease-in-out infinite alternate;
}

/* Layer 2: film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1.02) rotate(0deg); }
  50%  { transform: translate3d(-2.5%, 1.5%, 0) scale(1.08) rotate(-1.2deg); }
  100% { transform: translate3d(2.5%, -1%, 0) scale(1.05) rotate(1deg); }
}

/* ---------- Floating glow orbs ---------- */
.orb {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  mix-blend-mode: screen;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.orb--1 {
  width: 340px; height: 340px;
  top: 6%; left: 10%;
  background: radial-gradient(circle, rgba(255, 122, 48, 0.9) 0%, transparent 70%);
  animation: orb-float-1 19s ease-in-out infinite alternate,
             orb-pulse 7s ease-in-out infinite;
}

.orb--2 {
  width: 400px; height: 400px;
  bottom: 4%; right: 8%;
  background: radial-gradient(circle, rgba(91, 109, 255, 0.85) 0%, transparent 70%);
  animation: orb-float-2 23s ease-in-out infinite alternate,
             orb-pulse 9s ease-in-out infinite 1.2s;
}

.orb--3 {
  width: 280px; height: 280px;
  top: 42%; right: 26%;
  background: radial-gradient(circle, rgba(177, 75, 255, 0.8) 0%, transparent 70%);
  animation: orb-float-3 16s ease-in-out infinite alternate,
             orb-pulse 6s ease-in-out infinite 0.5s;
}

@keyframes orb-float-1 {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(18vw, 12vh, 0); }
}
@keyframes orb-float-2 {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-16vw, -10vh, 0); }
}
@keyframes orb-float-3 {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-12vw, 14vh, 0); }
}
@keyframes orb-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .orb { animation: none !important; opacity: 0.45; }
  .wrap::before { animation: none; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 56px auto;
  padding: 56px 40px 64px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 var(--glass-hi) inset, 0 24px 60px -24px var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}

/* Animated gradient border — a bright arc sweeps around the card edge.
   A conic gradient is masked to a 1.5px ring via mask-composite. */
@property --bd-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--bd-angle),
    transparent 0deg,
    transparent 55deg,
    rgba(255, 122, 48, 0.85) 80deg,
    rgba(177, 75, 255, 0.95) 100deg,
    rgba(91, 109, 255, 0.85) 120deg,
    transparent 150deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  animation: border-sweep 6s linear infinite;
}

@keyframes border-sweep {
  to { --bd-angle: 360deg; }
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar--fallback {
  font-weight: 700;
  font-size: 22px;
  color: var(--muted-strong);
  letter-spacing: 0;
}

.name {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.bio {
  margin: 0;
  color: var(--muted-strong);
  font-size: 14px;
  max-width: 42ch;
  text-wrap: pretty;
}

.top-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.top-links a {
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.top-links a:hover { color: var(--accent); }

.arrow { font-size: 12px; }

/* ---------- Rules ---------- */
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

/* ---------- Sections ---------- */
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 14px;
}

.rows { list-style: none; margin: 0; padding: 0; }

.row { border-bottom: 1px solid transparent; position: relative; }

.row-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 8px;
  margin: 0 -8px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

.row-link:hover { background: rgba(255, 255, 255, 0.06); }
.row-link:hover .row-name { color: var(--accent); }

.row-name {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color 0.15s ease;
}

.favicon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
  /* light chip so dark / transparent favicons stay visible on the dark card */
  background: #fff;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* full-bleed icon: a complete app icon that already has its own
   background — fill the chip edge-to-edge instead of framing it */
.favicon--bleed {
  background: transparent;
  padding: 0;
  object-fit: cover;
}

/* monogram fallback when a site has no favicon */
.favicon--mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(135deg, #ff7a45, #b14bff 55%, #5b6dff);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.row-meta {
  color: var(--meta);
  font-size: 13px;
  text-align: right;
  transition: color 0.15s ease;
}

.row-link:hover .row-meta { color: var(--ink); }

/* ---------- Hover preview cards ---------- */
.preview {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: 340px;
  max-width: min(340px, 78vw);
  background: rgba(11, 12, 17, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 1px 0 var(--glass-hi) inset, 0 24px 50px -16px rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  backdrop-filter: blur(16px) saturate(1.35);
  overflow: hidden;
  /* instant, no delay — just a quick polish fade */
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  transform-origin: bottom left;
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
}

.row:hover .preview,
.row-link:focus-visible + .preview {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.preview-media {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: linear-gradient(135deg, #15161d, #0c0d12);
  border-bottom: 1px solid var(--line);
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-media--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff7a45, #b14bff 55%, #5b6dff);
  color: #fff;
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.02em;
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 14px;
}

.preview-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.preview-desc {
  font-size: 12px;
  color: var(--meta);
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .preview { transition: opacity 0.08s ease; transform: none; }
  .row:hover .preview { transform: none; }
}

/* Touch / small screens: no hover, so drop the previews entirely */
@media (max-width: 760px), (hover: none) {
  .preview { display: none; }
}

/* ---------- Contact form ---------- */
.contact-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.field input,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  resize: vertical;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.submit {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(100deg, #5b6dff 0%, #b14bff 45%, #ff5566 100%);
  border: 0;
  border-radius: 8px;
  padding: 11px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(177, 75, 255, 0.6);
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.submit:hover { filter: brightness(1.08) saturate(1.1); box-shadow: 0 10px 28px -8px rgba(255, 85, 102, 0.6); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: 0.6; cursor: default; }

.form-status {
  margin: 0;
  font-size: 13px;
  color: var(--muted-strong);
}
.form-status.ok { color: #57d98a; }
.form-status.err { color: #ff6a6a; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-credit { text-align: center; }

.footer-credit a {
  color: var(--muted-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-credit a:hover { color: var(--accent); }

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

/* Tablet */
@media (max-width: 760px) {
  .wrap { margin: 32px 24px; padding: 44px 32px 52px; }
}

/* Phone */
@media (max-width: 560px) {
  body { font-size: 14px; }
  .wrap {
    margin: calc(16px + env(safe-area-inset-top)) 14px 16px;
    margin-left: max(14px, env(safe-area-inset-left));
    margin-right: max(14px, env(safe-area-inset-right));
    padding: 32px 20px 44px;
    border-radius: 14px;
    /* lighter blur for smoother scrolling on mobile GPUs */
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
  }
  .name { font-size: 17px; }
  .avatar { width: 56px; height: 56px; }
  .header { flex-direction: column; gap: 16px; }
  .top-links { flex-direction: row; align-items: flex-start; gap: 20px; }
  /* comfortable tap targets */
  .top-links a { padding: 4px 0; }
  .row-link { flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 8px; }
  .row-meta { text-align: left; }
  .rule { margin: 26px 0; }
  .form-foot { gap: 12px; }
  .submit { width: 100%; text-align: center; padding: 13px 20px; }
  .footer { flex-wrap: wrap; gap: 8px 16px; }
}

/* Disable the heavy blurred background animation on touch / small devices
   and trim the blur radius — big quality-of-life win for battery + jank. */
@media (max-width: 560px), (hover: none) {
  body::before {
    animation: none;
    filter: blur(45px) saturate(1.2);
  }
  /* keep the orbs as static glows, drop the per-frame float/pulse repaints */
  .orb {
    animation: none;
    opacity: 0.4;
    filter: blur(50px);
  }
  /* freeze the border sweep into a soft static gradient edge */
  .wrap::before { animation: none; }
}

/* Dark by design — palette is fixed regardless of system colour scheme. */
:root { color-scheme: dark; }
