/* Chunky, tactile UI: thick borders and a solid "lip" under every button
   and card, which drops away when pressed. Blue header, black content. */
:root {
  --bg: #000000;
  --surface: #111114;
  --surface-2: #18181D;
  --edge: #2A2A33;          /* borders and the lip under cards */
  --edge-2: #3A3A46;
  --text: #F3F3F7;
  --muted: #A3A3B1;
  --faint: #6F6F7D;

  /* taken from the profile logo: deep royal blue, with a cyan-to-violet glyph */
  --navy: #0A0C80;
  --navy-lip: #03043F;
  --blue: #2F3FE6;
  --blue-lip: #1A2394;
  --blue-ink: #7FD2FF;
  --purple: #8854FF;
  --purple-lip: #5A2FC4;
  --purple-ink: #B9A0FF;
  --pink: #FF5C9D;
  --pink-lip: #C2346D;
  --cyan: #3CCFE0;

  --lip: 4px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --gutter: 16px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* slow drift between black and a very dark purple */
  animation: bg-drift 16s ease-in-out infinite alternate;
}
@keyframes bg-drift { from { background-color: #000; } to { background-color: #12081F; } }
body.editor-open { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; }

/* ───────── tactile surfaces and buttons ───────── */
.tactile {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: 0 var(--lip) 0 var(--edge);
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease, border-color .15s ease;
}
a.tactile:hover { background: var(--surface-2); border-color: var(--edge-2); box-shadow: 0 var(--lip) 0 var(--edge-2); }
a.tactile:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--edge-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 0; border-radius: var(--r-md);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; color: #fff; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(var(--lip)); box-shadow: none; }
.btn-blue { background: var(--blue); box-shadow: 0 var(--lip) 0 var(--blue-lip); }
.btn-purple { background: var(--purple); box-shadow: 0 var(--lip) 0 var(--purple-lip); }
.btn-pink { background: var(--pink); box-shadow: 0 var(--lip) 0 var(--pink-lip); }
.btn-ghost { background: var(--surface); color: var(--text); border: 2px solid var(--edge); box-shadow: 0 var(--lip) 0 var(--edge); }
.btn-ghost:hover { filter: none; background: var(--surface-2); }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.chip {
  font-family: var(--mono);
  flex: none; align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 2px solid var(--edge);
}
.status-live { color: var(--cyan); border-color: #1D4C55; background: #0B2024; }
.status-in-dev { color: var(--purple-ink); border-color: #3B2F72; background: #1A1533; }
.status-soon { color: var(--blue-ink); border-color: #263F78; background: #0F1A33; }

/* ───────── loading screen ───────── */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: var(--navy);
  transition: opacity .3s ease, visibility .3s ease;
  /* colors cycle behind the logo; if the scripts never run, don't trap the page behind the loader */
  animation: loader-colors 2.4s ease-in-out infinite, loader-giveup 0s 8s forwards;
}
@keyframes loader-colors {
  0%, 100% { background-color: #0A0C80; }
  33% { background-color: #3A1690; }
  66% { background-color: #1730C8; }
}
.loader.is-done { opacity: 0; visibility: hidden; }
@keyframes loader-giveup { to { opacity: 0; visibility: hidden; } }
.loader-avatar {
  position: relative;
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge);
  background: var(--navy); overflow: hidden;
  animation: loader-bob 1.1s ease-in-out infinite, loader-halo 2.4s ease-in-out infinite;
}
@keyframes loader-halo {
  0%, 100% { box-shadow: 0 5px 0 var(--edge), 0 0 0 10px rgba(127, 210, 255, .25), 0 0 60px 20px rgba(47, 63, 230, .55); }
  50% { box-shadow: 0 5px 0 var(--edge), 0 0 0 10px rgba(185, 160, 255, .3), 0 0 60px 20px rgba(136, 84, 255, .6); }
}
.loader-avatar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #fff; }
.loader-avatar img { position: relative; width: 100%; height: 100%; object-fit: cover; }
@keyframes loader-bob { 50% { transform: translateY(-6px); } }
.loader-bar {
  width: min(240px, 60vw); height: 18px;
  background: var(--surface-2); border-radius: 999px; overflow: hidden;
  border: 2px solid var(--edge);
}
.loader-bar span {
  position: relative; display: block; height: 100%; width: 8%;
  background: var(--blue); border-radius: 999px;
  animation: loader-fill 1.4s cubic-bezier(.2, .7, .3, 1) forwards;
}
/* the light strip along the top of the fill */
.loader-bar span::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .35);
}
.loader.is-done .loader-bar span { width: 100%; animation: none; transition: width .2s ease; }
@keyframes loader-fill { to { width: 85%; } }

/* ───────── header ───────── */
.top { position: sticky; top: 0; z-index: 10; background: var(--navy); }
.top-inner {
  max-width: 940px; margin: 0 auto;
  padding: 12px var(--gutter) 14px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
}
.top-inner .nav { justify-self: end; }

/* sign in / signed-in user, at the right of the header */
.account { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.account-photo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--blue-ink); }
.account-photo.is-letter { display: grid; place-items: center; background: #000; font-weight: 700; }
.account-name { font-weight: 600; max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-out {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px;
}
.btn-signin {
  min-height: 42px; padding: 6px 16px; font-size: 14px;
  background: #fff; color: var(--navy);
  box-shadow: 0 var(--lip) 0 #8E93D6;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: 26px; letter-spacing: -0.01em;
}
/* black gap + light ring so the blue logo stands apart from the blue bar */
.brand-icon {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none;
  border: 3px solid #000;
  box-shadow: 0 0 0 2px var(--blue-ink), 0 4px 0 2px var(--navy-lip);
}
.brand-icon.is-letter, .brand-icon.is-glyph { display: grid; place-items: center; background: #000; color: #fff; font-size: 16px; }

.nav { display: flex; gap: 10px; }
.nav a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  background: #000; color: #C9C9D4;
  border: 2px solid #000; border-radius: var(--r-md);
  box-shadow: 0 var(--lip) 0 var(--navy-lip);
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease, color .15s ease;
}
.nav a img { width: 20px; height: 20px; object-fit: contain; }
.nav a:hover { color: #fff; }
.nav a:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--navy-lip); }
.nav a[aria-current="page"] { color: #fff; border-color: var(--blue-ink); }

@media (max-width: 560px) {
  .top-inner { grid-template-columns: 1fr auto; gap: 10px; }
  .top-inner .nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .account { grid-column: 2; grid-row: 1; }
  .brand { font-size: 22px; }
  .account-name { display: none; }
  .nav { gap: 8px; }
  .nav a { flex: 1; padding: 8px 4px; font-size: 13px; letter-spacing: 0.03em; gap: 6px; }
  .nav a img { width: 18px; height: 18px; }
}

/* ───────── page ───────── */
.page {
  flex: 1;
  width: 100%; max-width: 940px; margin: 0 auto;
  padding: 34px var(--gutter) 56px;
}
.page-title {
  font-size: clamp(34px, 8.5vw, 56px);
  font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1;
}
.page-intro { margin-top: 10px; color: var(--muted); font-size: 18px; font-weight: 400; max-width: 46ch; }

.block { margin-top: 38px; --accent-ink: var(--purple-ink); }
.accent-blue { --accent-ink: var(--blue-ink); }
.accent-pink { --accent-ink: var(--pink); }
.label {
  font-family: var(--mono);
  margin-bottom: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink);
}

/* ───────── socials ───────── */
.social-grid { display: grid; gap: 14px 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .social-grid { gap: 16px; } }
.social-grid li, .channel-grid li, .project-list li { min-width: 0; }

.social {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  height: 100%; padding: 16px 8px 14px;
}
@media (min-width: 640px) { .social { flex-direction: row; text-align: left; gap: 14px; padding: 16px; } }
.social-tile, .channel-tile, .project-tile {
  flex: none; display: grid; place-items: center;
  background: #000; border: 2px solid var(--edge); border-radius: var(--r-sm);
  overflow: hidden;
}
.social-tile { width: 46px; height: 46px; }
.social-icon { width: 30px; height: 30px; object-fit: contain; }
.is-glyph svg { width: 100%; height: 100%; fill: currentColor; }
.social-icon.is-glyph { width: 24px; height: 24px; color: #fff; }
.is-letter { display: grid; place-items: center; font-weight: 700; color: var(--purple-ink); }
.social-text { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.social-name { font-weight: 600; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { .social-name { font-size: 14px; } }
.social-handle { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-unlinked { opacity: .5; }

/* ───────── youtube ───────── */
.channel-grid { display: grid; gap: 22px 16px; }
@media (min-width: 700px) { .channel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.channel-col { display: flex; flex-direction: column; gap: 12px; }
.channel {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 18px 14px 16px;
}
.channel-tile { width: 54px; height: 54px; margin: 8px 0 6px; color: #fff; }
.channel-tile svg { width: 30px; height: 30px; fill: currentColor; }
.channel-kind {
  font-family: var(--mono);
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--blue);
}
.kind-main .channel-kind {
  font-family: var(--mono); background: var(--purple); }
.kind-archived .channel-kind {
  font-family: var(--mono); background: var(--edge); color: var(--muted); }
.channel-name { font-weight: 700; font-size: 18px; line-height: 1.25; }
.channel-handle { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.channel-desc { color: var(--muted); font-size: 14px; text-align: center; padding: 0 8px; }

/* ───────── projects ───────── */
.project-list { display: grid; gap: 16px; }
.soon {
  padding: 26px 20px;
  border: 2px dashed var(--edge-2); border-radius: var(--r-lg);
  color: var(--muted); font-size: 24px; font-weight: 700;
}
.project {
  padding: 18px;
  background: var(--surface);
  border: 2px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: 0 var(--lip) 0 var(--edge);
}
.project-head { display: flex; align-items: center; gap: 14px; }
.project-tile { width: 60px; height: 60px; border-radius: var(--r-md); }
.project-icon { width: 100%; height: 100%; object-fit: cover; }
.project-icon.is-letter { font-size: 24px; }
.project-title { min-width: 0; flex: 1; }
.project-title h3 { font-size: 22px; font-weight: 700; line-height: 1.15; }
.project-period { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.project-desc { margin-top: 12px; color: #D2D2DC; max-width: 62ch; }
.project-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* ───────── app page ───────── */
.page-app { max-width: 1200px; padding-top: 20px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.app-head { display: flex; align-items: center; gap: 12px; }
.app-title { flex: 1; min-width: 0; font-size: 24px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-status { color: var(--muted); padding: 40px 0; text-align: center; }
.app-frame {
  width: 100%; height: calc(100vh - 230px); min-height: 420px;
  background: #fff;
  border: 2px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: 0 var(--lip) 0 var(--edge);
}

/* ───────── about ───────── */
.bio { margin-top: 18px; max-width: 60ch; font-size: 19px; font-weight: 400; color: #DCDCE6; }
.bio p + p { margin-top: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 12px 10px; }
.tags li {
  padding: 7px 14px;
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-sm);
  box-shadow: 0 3px 0 var(--edge);
  font-size: 15px; font-weight: 600;
}
.history { border-left: 3px solid var(--edge); }
.history li {
  position: relative;
  display: grid; grid-template-columns: 130px 1fr; gap: 4px 18px;
  padding: 0 0 24px 22px;
}
.history li::before {
  content: ''; position: absolute; left: -9px; top: 4px;
  width: 15px; height: 15px; background: var(--bg); border: 3px solid var(--blue); border-radius: 50%;
}
.history li:first-child::before { background: var(--blue); }
.history li:last-child { padding-bottom: 0; }
.history-when { font-family: var(--mono); color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 1px; }
.history h3 { font-size: 18px; font-weight: 700; }
.history p { color: var(--muted); margin-top: 2px; }
@media (max-width: 520px) { .history li { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ───────── footer ───────── */
.foot { background: var(--surface); border-top: 2px solid var(--edge); }
.foot-inner {
  max-width: 940px; margin: 0 auto;
  padding: 24px var(--gutter) 8px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.foot-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-paypal { background: #0070E0; box-shadow: 0 var(--lip) 0 #00428A; }
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 120; transform: translateX(-50%);
  width: min(520px, calc(100% - 32px)); padding: 12px 16px;
  background: var(--surface-2); border: 2px solid var(--edge-2); border-radius: var(--r-md);
  box-shadow: 0 var(--lip) 0 var(--edge); color: var(--text); font-size: 15px;
}
.foot-social {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  background: #000; border: 2px solid var(--edge); border-radius: var(--r-sm);
  box-shadow: 0 var(--lip) 0 var(--edge);
  color: #fff;
  transition: transform .08s ease, box-shadow .08s ease, border-color .15s ease;
}
a.foot-social:hover { border-color: var(--edge-2); }
a.foot-social:active { transform: translateY(var(--lip)); box-shadow: none; }
.foot-social-icon { width: 24px; height: 24px; object-fit: contain; }
.foot-social-icon.is-glyph { width: 20px; height: 20px; }
.foot-note { max-width: 940px; margin: 0 auto; padding: 10px var(--gutter) 22px; color: var(--faint); font-size: 14px; font-weight: 700; }
@media (max-width: 520px) {
  .foot-actions { width: 100%; }
  .foot-actions .btn { flex: 1; }
  .foot-socials { gap: 8px; }
  .foot-social { width: 42px; height: 42px; }
}
.noscript { padding: 16px; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0s !important; }
  .loader { animation: loader-giveup 0s 8s forwards !important; }
}
