:root {
  --accent: #1aa3d6;
  --nav: #a9dcef;
  --text: #e8eef2;
  --muted: #8c99a3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  background: #030304;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}

/* ---------- background ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nebula {
  position: fixed; inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 30% 20% at 25% 15%, rgba(140, 80, 30, 0.16), transparent 70%),
    radial-gradient(ellipse 25% 18% at 60% 30%, rgba(120, 70, 40, 0.12), transparent 70%),
    radial-gradient(ellipse 20% 25% at 30% 60%, rgba(60, 90, 110, 0.12), transparent 70%),
    radial-gradient(ellipse 25% 20% at 75% 65%, rgba(90, 70, 50, 0.10), transparent 70%),
    radial-gradient(ellipse 20% 20% at 95% 20%, rgba(40, 40, 120, 0.14), transparent 70%);
  filter: blur(20px);
  animation: float 40s ease-in-out infinite alternate;
}
@keyframes float { to { transform: translate(2%, -2%) scale(1.04); } }

/* ---------- center ---------- */
main {
  position: relative; z-index: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  align-self: center;
}
nav { display: flex; flex-direction: column; gap: 4px; }
nav a {
  color: var(--nav);
  text-decoration: none;
  font-size: 32px;
  line-height: 1.3;
  transition: color .2s, transform .2s;
}
nav a:hover { color: #fff; transform: translateX(4px); }
.email {
  margin-top: 5px;
  margin-left: 5px;
  font-size: 15px;
  color: var(--accent);
  text-decoration: underline;
}
.email:hover { color: #fff; }

.profile { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar {
  width: 200px; height: 200px;
  border-radius: 50%;
  object-fit: cover;
  background: #15181b;
  margin-bottom: 8px;
}

h1 {
  font-family: "Archivo Black", sans-serif;
  color: var(--accent);
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.tagline { color: var(--accent); font-size: 16px; font-weight: 500; margin-top: 4px; }

/* ---------- corners ---------- */
.sites {
  position: fixed; left: 0; bottom: 0; z-index: 2;
  background: rgba(60, 60, 75, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 0 8px 0 0;
  padding: 10px 14px 10px 10px;
}
.sites-title { font-size: 12px; font-weight: 500; letter-spacing: 1px; color: #c8c8d4; margin-bottom: 6px; }
.sites-list { display: flex; gap: 8px; }
.sites-list img { width: 88px; height: 31px; display: block; image-rendering: pixelated; }

.clocks {
  position: fixed; z-index: 2;
  text-align: right;
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  color: #f2f2f2;
}
.clocks.top-left { top: 10px; left: 12px; text-align: left; }
.clocks.top-right { top: 10px; right: 12px; }
.clocks.bottom-left { bottom: 6px; left: 12px; text-align: left; }
.clocks.bottom-right { bottom: 6px; right: 6px; }
.clocks sup { font-size: 9px; vertical-align: top; position: relative; top: 1px; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { overflow: auto; }
  main { flex-direction: column; height: auto; min-height: 100%; padding: 48px 16px 120px; gap: 24px; }
  .menu { border-left: 0; border-top: 2px solid var(--accent); padding: 16px 0 0; align-items: center; text-align: center; margin-top: 0; }
  .profile { align-items: center; text-align: center; }
  nav a { font-size: 26px; }
  .avatar { width: 160px; height: 160px; }
}

/* ---------- about page ---------- */
body.page { overflow-y: auto; background: #070d17; }
body.page #sky { display: none; }
body.page .nebula {
  filter: blur(40px);
  background:
    radial-gradient(ellipse 50% 45% at 0% 0%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 50% at 100% 100%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    radial-gradient(ellipse 35% 30% at 95% 5%, rgba(70, 60, 200, 0.18), transparent 70%),
    radial-gradient(ellipse 35% 35% at 5% 95%, rgba(40, 110, 200, 0.14), transparent 70%);
  animation: glow 20s ease-in-out infinite alternate;
}
@keyframes glow {
  50% { transform: translate(3%, 2%) scale(1.06); opacity: .85; }
  to  { transform: translate(-2%, 3%) scale(1.02); }
}
main.about {
  height: auto;
  min-height: 100%;
  max-width: 780px;
  margin: 0 auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  padding: 56px 16px;
  font-family: "Courier Prime", monospace;
}
.back {
  color: var(--nav);
  text-decoration: none;
  font-size: 15px;
  align-self: flex-start;
  transition: color .2s, transform .2s;
}
.back:hover { color: #fff; transform: translateX(-4px); }

.panel {
  background: #111c2c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 22px 26px;
}
#about-sections .panel-text { margin: 12px 0 22px; }

/* line with text in the middle */
.rule { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15px; }
.rule::before, .rule::after { content: ""; flex: 1; height: 2px; background: #e8e8f0; }
.rule:empty { gap: 0; }
.rule:empty::after { display: none; }
.rule span:empty { display: none; }

.about-head { display: flex; gap: 18px; align-items: flex-start; margin: 22px 0 26px; }
.avatar.square { width: 126px; height: 126px; border-radius: 6px; margin: 0; flex-shrink: 0; }
.about-head h1 {
  font-family: "Courier Prime", monospace;
  color: #f2f0f8;
  font-size: 42px;
  letter-spacing: 1px;
  line-height: 1.1;
}
.subtitle { color: #f2f0f8; font-weight: 700; font-size: 16px; margin: 10px 0 12px; }

.rows { border-collapse: collapse; font-size: 13px; }
.rows td { padding: 1px 0; vertical-align: top; }
.rows td:first-child { color: #d8d6e2; padding-right: 22px; white-space: nowrap; }
.rows a, .rows b { color: var(--accent); font-weight: 700; text-decoration: none; }
.rows a:hover { color: #fff; }
.ext { width: 11px; height: 11px; fill: currentColor; margin-left: 4px; vertical-align: -1px; }

.panel-text { margin-top: 16px; color: #e4e2ee; font-size: 15px; line-height: 1.7; }
.panel-text > * + * { margin-top: 10px; }
.panel-text ul { padding-left: 22px; }
.panel-text li { margin: 2px 0; }
.panel-text li::marker { color: var(--accent); }

/* tabs on the right: folder tabs sticking out of the block */
.about-layout { position: relative; display: flex; align-items: flex-start; }
.about-layout .panel { flex: 1; min-width: 0; position: relative; z-index: 2; }
.tabs {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  left: 100%;
  top: 70px;
}
.tabs-title { display: none; }
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 150px;
  margin-left: -10px;
  padding: 12px 16px 12px 24px;
  background: #0c1522;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #7f8ba0;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: transform .2s ease, background .2s, color .2s, width .2s;
}
.tab-icon { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.tab-label { flex: 1; }
.tab-num { display: none; }
.tabs a:hover { color: #fff; transform: translateX(6px); background: #0f1a2a; }
.tabs a.active {
  z-index: 3;
  width: 164px;
  background: #111c2c;
  color: #fff;
  margin-left: -12px;
  box-shadow: 4px 4px 14px rgba(0, 0, 0, .35);
}
.tabs a.active .tab-icon { color: var(--accent); }
.tabs a.active::after {
  content: "";
  position: absolute; right: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--accent);
}

@media (max-width: 1120px) {
  .about-layout { flex-direction: column; align-items: stretch; }
  .tabs { flex-direction: row; padding: 0 10px; position: static; order: -1; gap: 4px; }
  .tabs a, .tabs a.active { width: auto; flex: 1; justify-content: center; margin: 0 0 -10px; padding: 10px 10px 20px; border: 1px solid rgba(255,255,255,.06); border-bottom: 0; border-radius: 10px 10px 0 0; }
  .tabs a:hover { transform: translateY(-3px); }
  .tabs a { white-space: nowrap; font-size: 12px; gap: 6px; }
  .tabs a.active { margin-bottom: -12px; }
  .tabs a.active::after { left: 10px; right: 10px; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
}

@media (max-width: 560px) {
  .about-head { flex-direction: column; align-items: center; text-align: center; }
  .rows { margin: 0 auto; text-align: left; }
  .about-head h1 { font-size: 34px; }
}

/* ---------- project cards ---------- */
.projects { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.project {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
  background: #0c1522;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.project:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.project img { width: 64px; height: 64px; flex-shrink: 0; object-fit: cover; display: block; border-radius: 12px; margin: 12px 0 12px 12px; align-self: center; }
.project-body { padding: 10px 14px; flex: 1; min-width: 0; }
.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.project h3 { font-family: "Courier Prime", monospace; font-size: 17px; color: #fff; }
.project-url { color: var(--accent); font-size: 13px; font-weight: 700; }
.project p { color: #cfd6e2; font-size: 12.5px; line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tags span {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.btn {
  display: inline-flex; align-items: center;
  margin: 8px 0 22px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-weight: 700; font-size: 14px;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--accent); color: #fff; }

@media (max-width: 560px) {
  .project img { width: 52px; height: 52px; }
  .project p { -webkit-line-clamp: 3; }
}
.project-thumb {
  width: 64px; height: 64px; flex-shrink: 0;
  margin: 12px 0 12px 12px; align-self: center;
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: "Courier Prime", monospace; font-weight: 700; font-size: 28px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, #0a121e);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.tags .lang { color: #e8e8f0; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.06); }
@media (max-width: 560px) { .project-thumb { width: 52px; height: 52px; font-size: 22px; } }

/* ---------- home effects ---------- */
.tagline.typing::after { content: "▍"; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.profile .avatar { transition: transform .15s ease-out; will-change: transform; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.trail {
  position: fixed; left: -5px; top: -5px; z-index: 50;
  width: 10px; height: 10px; border-radius: 50%;
  pointer-events: none;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

/* ---------- discord + spotify ---------- */
.presence {
  margin-top: 14px;
  width: 280px;
  max-width: 100%;
  text-align: left;
  font-size: 13px;
}
.pres-status { display: flex; align-items: center; justify-content: center; gap: 8px; color: #c9d1de; }
.pres-status b { color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #747f8d; flex-shrink: 0; }
.dot.online { background: #3ba55d; box-shadow: 0 0 8px #3ba55d; }
.dot.idle { background: #faa61a; box-shadow: 0 0 8px #faa61a; }
.dot.dnd { background: #ed4245; box-shadow: 0 0 8px #ed4245; }
.spotify {
  display: flex; gap: 10px; align-items: center;
  margin-top: 10px; padding: 10px;
  background: rgba(17, 28, 44, .75);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  color: inherit; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.spotify:hover { border-color: #1db954; transform: translateY(-2px); }
.spotify img { width: 58px; height: 58px; border-radius: 6px; flex-shrink: 0; }
.sp-info { flex: 1; min-width: 0; }
.sp-label { font-size: 10px; color: #1db954; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.sp-song, .sp-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-song { color: #fff; font-weight: 500; }
.sp-artist { color: #9aa5b5; font-size: 12px; }
.sp-bar { height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 0; background: #1db954; transition: width 1s linear; }
.sp-times { display: flex; justify-content: space-between; font-size: 10px; color: #7f8ba0; margin-top: 2px; }

/* ---------- anime grid ---------- */
.anime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.anime { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 6px; --glow: var(--accent); }
.anime-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: #0c1522 center / cover no-repeat;
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .2s, box-shadow .2s;
}
.anime:hover .anime-cover { transform: translateY(-4px); box-shadow: 0 8px 22px color-mix(in srgb, var(--glow) 55%, transparent); }
.anime span { font-size: 12px; line-height: 1.3; color: #cfd6e2; }
.score {
  position: absolute; top: 6px; right: 6px;
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,.75); color: #ffd35c;
}

/* ---------- socials ---------- */
.socials { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.social {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: #0c1522;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: inherit; text-decoration: none;
  font: inherit; text-align: left; cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.social:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}
.social-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
}
.social-icon svg { width: 22px; height: 22px; fill: currentColor; }
.social-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.social-text b { color: #fff; font-size: 14px; }
.social-text span { color: #9aa5b5; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social-go { font-size: 11px; color: #5d6b80; transition: color .2s; }
.social:hover .social-go { color: var(--brand); }

/* ---------- home page: white text ---------- */
body:not(.page) h1,
body:not(.page) .tagline,
body:not(.page) nav a,
body:not(.page) .email { color: #fff; }
body:not(.page) nav a:hover,
body:not(.page) .email:hover { color: var(--accent); }

/* ---------- custom cursor ---------- */
.custom-cursor, .custom-cursor * { cursor: none !important; }
.cur-dot, .cur-ring {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transition: opacity .2s;
}
.cur-dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: #fff;
  box-shadow: 0 0 6px var(--accent);
}
.cur-ring {
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 80%, white);
  transition: width .2s, height .2s, margin .2s, background .2s, border-color .2s, opacity .2s;
}
.cur-ring.hover {
  width: 48px; height: 48px; margin: -24px 0 0 -24px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
}
.cur-ring.down { width: 20px; height: 20px; margin: -10px 0 0 -10px; }

/* ---------- page transitions ---------- */
/* Modern browsers: pages cross-fade, and the block/tabs morph in place between tab pages. */
@view-transition { navigation: auto; }
.about-layout .panel { view-transition-name: panel; }
.tabs { view-transition-name: tabs; }
.back { view-transition-name: back; }
.clocks { view-transition-name: clock; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .32s ease both; }
::view-transition-group(panel), ::view-transition-group(tabs) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-new(panel) { animation: vt-in .3s ease both; }
::view-transition-old(panel) { animation: vt-out .2s ease both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* Older browsers: just fade the page in on load. */
@supports not (view-transition-name: x) {
  main { animation: fadein .45s ease both; }
}
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- pictures in page text ---------- */
.pics { display: grid; gap: 10px; margin: 14px 0 !important; }
.pics-2 { grid-template-columns: 1fr 1fr; }
.pics-3 { grid-template-columns: 1fr 1fr 1fr; }
.pics figure { margin: 0; position: relative; overflow: hidden; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); }
.pics img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .4s ease; }
.pics-1 img { height: 260px; }
.pics figure:hover img { transform: scale(1.05); }
.pics figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 10px 7px;
  font-size: 11px; color: #e8ecf2;
  background: linear-gradient(transparent, rgba(5, 10, 18, .85));
}
@media (max-width: 560px) { .pics-2, .pics-3 { grid-template-columns: 1fr; } .pics img { height: 180px; } }
.pics figure.contain { background: radial-gradient(circle, #ffffff 0%, #e6eaf0 100%); }
.pics figure.contain img { object-fit: contain; padding: 12px 0 26px; }

/* ---------- gallery ---------- */
.gallery { columns: 3 170px; column-gap: 10px; margin: 14px 0 22px; }
.g-item {
  display: block; width: 100%;
  margin: 0 0 10px; padding: 0;
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
  overflow: hidden; background: #0c1522;
  break-inside: avoid; cursor: pointer;
}
.g-item img { width: 100%; display: block; transition: transform .35s ease, filter .35s; }
.g-item:hover img { transform: scale(1.05); filter: brightness(1.1); }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: rgba(3, 6, 12, .92);
  backdrop-filter: blur(6px);
  animation: lb-in .2s ease;
}
@keyframes lb-in { from { opacity: 0; } }
.lightbox img { max-width: 90vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lb-btn {
  position: absolute;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: #fff; font-size: 30px; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s;
}
.lb-btn:hover { background: var(--accent); }
.lb-close { top: 18px; right: 18px; font-size: 28px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #cfd6e2; font-size: 13px; }
@media (max-width: 560px) { .gallery { columns: 2 120px; } .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; } }

/* ---------- phone fixes ---------- */
html, body { overflow-x: hidden; }
@media (max-width: 560px) {
  /* 5 tabs fit across: icon on top, small label underneath */
  .tabs { padding: 0 4px; gap: 3px; }
  .tabs a, .tabs a.active {
    flex: 1 1 0; min-width: 0;
    flex-direction: column; gap: 3px;
    padding: 8px 2px 18px;
    font-size: 10px;
  }
  .tabs .tab-label { overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
  .tabs .tab-icon { width: 15px; height: 15px; }
  /* 3 anime covers per row */
  .anime-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .anime span { font-size: 10px; }
  main.about { padding-top: 48px; }
}
@media (max-width: 560px) { body.page .clocks { position: absolute; } }
