: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: -2;
  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); }
}

@media (prefers-reduced-motion: reduce) {
  body::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);
}

/* ---------- 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; }

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

/* ---------- 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);
  }
}

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