:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #191a1d;
  --panel-raised: #202125;
  --ink: #f1f1f2;
  --muted-neutral: #a3a5aa;
  --line-neutral: #303237;
  --muted: var(--muted-neutral);
  --line: var(--line-neutral);
  --soft-line: #25272b;
  --neutral-accent: #cfd1d4;
  --ashline: #b87543;
  --ashline-bright: #d39a68;
  --fwob-cyan: #45c9ed;
  --fwob-blue: #2470c8;
  --fwob-navy: #111d63;
  --minecraft-green: #68a94a;
  --minecraft-green-bright: #8fc56b;
  --font-icon: "Roboto Slab", Georgia, serif;
  --font-title: "Roboto Slab", Georgia, serif;
  --font-supertitle: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --font-content: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --font-link: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  /* Shared opacity scale: surfaces, quiet UI, emphasis, and accent marks. */
  --alpha-surface: 1;
  --surface-start-rgb: 29, 30, 33;
  --surface-end-rgb: 23, 24, 26;
  --surface-tint: 8%;
  --alpha-faint: 0.06;
  --alpha-soft: 0.10;
  --alpha-accent: 0.20;
  --alpha-wash: 0.054;
  --alpha-accent-line: 0.36;
  --alpha-accent-strong: 0.42;
  --display: var(--font-title);
  --body: var(--font-content);
}

/* Page accents are generated from site/site.json into site-accents.css. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 30px 24px 92px;
  overflow-x: hidden;
  isolation: isolate;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.035), transparent 26rem),
    linear-gradient(180deg, #151619 0%, var(--bg) 38rem);
  font-family: var(--body);
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-image: url("/assets/seafloor-still.webp?v=1");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 1;
  animation: none;
  content: "";
}

body > * { position: relative; z-index: 1; }

/* The renderer supplies translucent white light over each page's base color. */
body > canvas.seafloor {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

html.seafloor-ready:not([data-theme="light"]) body::before { opacity: 0; }
html[data-theme="light"] canvas.seafloor { display: none; }

a { color: inherit; }
a, button { font-family: var(--font-link); }
h1, h2, h3 { font-family: var(--font-title); }

.home-shell,
.rankings-shell {
  width: min(1110px, 100%);
  margin: 0 auto;
}

.home-nav,
.rank-nav,
.subpage-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 28px;
}

.subpage-back-link {
  color: #b6b3c1;
  font-size: 0.85rem;
  text-decoration: none;
}

.subpage-back-link:hover,
.subpage-back-link:focus-visible {
  color: var(--page-accent-bright, var(--lime));
  outline: none;
}

/* Hover changes color only: no movement, no fade. */
a, button, .site-link, .button, .project-card, .text-link { transition: none; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #dedfe1;
  font: 600 0.95rem var(--font-link);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #4a4c51;
  border-radius: 0;
  color: #d8d9db;
  background: #1b1c1f;
  font-size: 0.95rem;
  font-family: var(--font-icon);
}

[data-accent] .wordmark-mark {
  border-color: rgba(var(--page-accent-rgb), var(--alpha-accent-strong));
  color: var(--page-accent-bright);
  background: rgba(var(--page-accent-rgb), var(--alpha-soft));
  box-shadow: 0 0 14px rgba(var(--page-accent-rgb), var(--alpha-accent));
}

.home-nav nav { display: flex; gap: 28px; }

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

.theme-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #44464b;
  border-radius: 6px;
  color: #c5c7ca;
  background: transparent;
  font: 600 0.72rem var(--font-link);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: #74777d;
  color: #fff;
}

.home-nav nav a {
  color: #b8babf;
  font-size: 0.88rem;
  text-decoration: none;
}

.home-nav nav a:hover,
.home-footer a:hover { color: #fff; }
.home-nav nav a span { color: inherit; }

.home-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 500px;
  align-items: center;
  padding: clamp(36px, 6vw, 74px);
  overflow: hidden;
  border: 1px solid #34363b;
  border-radius: 0;
}

.hero-copy { position: relative; z-index: 2; max-width: 630px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: #afb1b6;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-family: var(--font-supertitle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bfc1c4;
  box-shadow: 0 0 12px rgba(218, 220, 223, 0.28);
}

.home-hero h1 {
  margin: 0;
  font: 600 clamp(3.2rem, 8vw, 6.6rem) / 0.98 var(--display);
  letter-spacing: -0.08em;
}

.home-hero h1 span { color: inherit; }

.home-intro {
  max-width: 530px;
  margin: 24px 0 0;
  color: #b7b9bd;
  font-size: clamp(1.04rem, 1.6vw, 1.2rem);
  line-height: 1.72;
}

.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: min(240px, 100%); margin-top: 29px; }
.hero-actions > .site-link { width: 100%; justify-content: space-between; }
.hero-contacts { display: grid; gap: 8px; width: 100%; }
.hero-contacts .button > span:last-child { margin-left: auto; }

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

.subpage-links a {
  color: #b8babf;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.subpage-links a:hover,
.subpage-links a:focus-visible {
  color: #fff;
  outline: none;
}
.contact-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--contact-logo) center / contain no-repeat;
  mask: var(--contact-logo) center / contain no-repeat;
}
.icon-github { --contact-logo: url('/assets/social/github.svg'); }
.icon-twitter { --contact-logo: url('/assets/social/twitter.svg'); }
.icon-youtube { --contact-logo: url('/assets/social/youtube.svg'); }
.icon-discord { --contact-logo: url('/assets/social/discord.svg'); }
.icon-myanimelist { --contact-logo: url('/assets/social/myanimelist.svg'); }

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
}

.button-bright { color: #18191b; background: #d6d7d9; }
.button-bright:hover { background: #f2f2f3; }
.button-glass { border-color: #46484d; color: #dedfe1; background: rgba(255, 255, 255, var(--alpha-faint)); }
.button-glass:hover { border-color: #777a80; background: rgba(255, 255, 255, var(--alpha-soft)); }
.button span { font-size: 1rem; }

.hero-glow {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

.hero-glow-one {
  top: -190px;
  right: -80px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.065), transparent 68%);
}

.hero-glow-two {
  right: 110px;
  bottom: -285px;
  width: 420px;
  height: 380px;
  background: radial-gradient(circle, rgba(150, 154, 160, 0.07), transparent 70%);
}

.hero-orbit {
  position: absolute;
  top: 50%;
  right: 6%;
  display: grid;
  width: 315px;
  height: 315px;
  place-items: center;
  opacity: 0.82;
  transform: translateY(-53%);
}

.orbit-ring {
  position: absolute;
  display: block;
  border: 1px solid rgba(194, 196, 201, var(--alpha-accent));
  border-radius: 50%;
  transform: rotate(-24deg);
}

.ring-a { width: 270px; height: 105px; }
.ring-b { width: 242px; height: 242px; border-color: rgba(194, 196, 201, var(--alpha-soft)); border-style: dashed; }

.orbit-core {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border: 1px solid #56585e;
  border-radius: 10px;
  color: #e2e3e4;
  background: linear-gradient(145deg, #313338, #202125);
  box-shadow: 0 0 60px rgba(255, 255, 255, var(--alpha-faint));
  font: 600 3.3rem var(--display);
  font-family: var(--font-icon);
  transform: rotate(-9deg);
}

.orbit-star { position: absolute; color: #c9cbd0; }
.star-a { top: 43px; right: 57px; font-size: 1.5rem; }
.star-b { bottom: 39px; left: 43px; color: #8b8e94; font-size: 1.25rem; }

.orbit-label {
  position: absolute;
  right: 12px;
  bottom: 60px;
  color: #8f9197;
  font: 700 0.53rem / 1.5 var(--font-supertitle);
  letter-spacing: 0.15em;
}

.hero-bottom {
  position: absolute;
  right: clamp(28px, 6vw, 74px);
  bottom: 23px;
  left: clamp(28px, 6vw, 74px);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(220, 222, 225, var(--alpha-soft));
  color: #7f8187;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  font-family: var(--font-supertitle);
}

.projects-section { padding: 72px 4px 12px; scroll-margin-top: 24px; }
.blogs-section { padding-top: 46px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading .eyebrow { margin-bottom: 8px; color: #9ea0a6; }

.section-heading h2 {
  margin: 0;
  font: 600 clamp(1.9rem, 4vw, 2.8rem) / 1.1 var(--display);
  letter-spacing: -0.055em;
}

.section-note { margin: 0 3px 5px; color: var(--muted); font-family: var(--font-supertitle); font-size: 0.92rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }

.project-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--site-radius, 0);
}

.project-card[data-accent]:hover {
  border-color: rgba(var(--page-accent-rgb), 0.58);
}

.card-art {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  font-family: var(--font-icon);
  justify-content: space-between;
  padding: 19px 22px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, var(--alpha-faint));
}

.single-card-grid .project-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
}

.single-card-grid .card-art {
  min-height: 230px;
  border-right: 1px solid rgba(255, 255, 255, var(--alpha-faint));
  border-bottom: 0;
}

.single-card-grid .project-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 42px);
}

.art-ashline { background: transparent; }

.art-fwob { background: transparent; }

.art-minecraft { background: transparent; }

.art-kicker,
.art-caption {
  position: relative;
  z-index: 1;
  color: rgba(236, 237, 239, 0.69);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  font-family: var(--font-icon);
}

.project-body { padding: 20px 22px 23px; }
.project-label-row { display: flex; align-items: center; justify-content: space-between; }

.project-type {
  color: var(--ashline-bright);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-family: var(--font-supertitle);
}

.project-card[data-accent] .project-type { color: var(--page-accent-bright); }
.project-number { color: #74767c; font: 600 0.72rem var(--font-supertitle); }
.project-body h3 { margin: 10px 0 7px; font: 600 1.4rem var(--display); letter-spacing: -0.04em; }

.project-body p {
  max-width: 48ch;
  min-height: 48px;
  margin: 0;
  color: #a5a7ac;
  font-size: 0.93rem;
  line-height: 1.62;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  margin-top: 20px;
  padding: 9px 12px;
  border: 1px solid #414349;
  border-radius: 7px;
  background: rgba(255, 255, 255, var(--alpha-faint));
  color: #e8e9ea;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  background: rgba(255, 255, 255, var(--alpha-soft));
}

.project-card[data-accent] .text-link:hover,
.project-card[data-accent] .text-link span { color: var(--page-accent-bright); }

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.home-footer {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-top: 1px solid #34363b;
  border-radius: 0;
  color: #888a8f;

  backdrop-filter: blur(14px);
  font-size: 0.76rem;
}

.home-footer > span:first-child { color: #ced0d3; font-family: var(--font-title); font-weight: 700; }
.home-footer a { margin-left: auto; color: #a3a5aa; text-decoration: none; }

.footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-actions a,
.home-footer .back-to-top { margin-left: 0; }

.footer-actions > * { flex-shrink: 0; white-space: nowrap; }
.home-footer.footer-compact .footer-actions a[target="_blank"] { display: none; }
/* Keep the footer safe on first paint, before measuring the available width. */
@media (max-width: 960px) {
  .home-footer:not(.footer-measured) .footer-actions a[target="_blank"] { display: none; }
}

.home-footer .back-to-top { margin-left: 0; }

@media (max-width: 760px) {
  body { padding: 20px 15px 92px; }
  .home-nav { margin-bottom: 18px; }
  .home-hero { min-height: 455px; padding: 54px 27px; }
  .hero-orbit { top: 61%; right: -75px; opacity: 0.38; transform: translateY(-50%) scale(0.78); }
  .hero-copy { max-width: 560px; }
  .home-intro { max-width: 460px; }
  .hero-bottom { right: 25px; left: 25px; flex-wrap: wrap; font-size: 0.55rem; }
  .projects-section { padding-top: 55px; }
  .project-grid { gap: 12px; }
  .card-art { min-height: 165px; }
  .project-body { padding: 17px; }
  .project-body p { min-height: 72px; }
  .single-card-grid .project-card { grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr); }
}

@media (max-width: 540px) {
  body { padding-bottom: 138px; }
  .home-nav,
  .rank-nav,
  .subpage-nav { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .home-nav .nav-actions,
  .rank-nav .nav-actions,
  .subpage-nav .nav-actions { width: 100%; justify-content: space-between; }
  .nav-actions { gap: 10px; }
  .home-nav nav { align-items: center; gap: 13px; }
  .home-nav nav a { font-size: 0.78rem; }
  .subpage-links { flex: 1 1 auto; gap: 13px; min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .subpage-links::-webkit-scrollbar { display: none; }
  .subpage-links a { font-size: 0.78rem; }
  .wordmark { font-size: 0.82rem; }
  .wordmark-mark { width: 28px; height: 28px; }
  .home-hero { min-height: 430px; padding: 52px 22px; border-radius: 12px; }
  .home-hero h1 { font-size: clamp(3.3rem, 16vw, 5rem); }
  .home-intro { font-size: 1rem; line-height: 1.62; }
  .hero-orbit { top: 66%; right: -112px; opacity: 0.22; transform: translateY(-50%) scale(0.68); }
  .hero-bottom { right: 22px; bottom: 17px; left: 22px; }
  .hero-bottom span:last-child { display: none; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-note { font-size: 0.85rem; }
  .project-grid { grid-template-columns: 1fr; }
  .single-card-grid .project-card { display: block; }
  .single-card-grid .card-art { min-height: 180px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.055); }
  .card-art { min-height: 180px; }
  .project-body p { min-height: 0; }
  .home-footer { right: 0; bottom: 0; left: 0; flex-wrap: wrap; gap: 7px 14px; }
  .footer-actions { order: 3; width: 100%; justify-content: center; gap: 12px; }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eaec;
  --panel: #f5f5f6;
  --panel-raised: #fff;
  --ink: #202124;
  --muted-neutral: #666a70;
  --line-neutral: #cfd1d4;
  --muted: var(--muted-neutral);
  --line: var(--line-neutral);
  --soft-line: #d8dadd;
}

html[data-theme="light"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 252, 241, 0.94), transparent 28rem),
    linear-gradient(180deg, #f4eedf 0%, #ebe2d0 38rem);
}

html[data-theme="light"] body::before {
  background-image: url("/assets/paper-texture-v4.webp");
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 720px 720px;
  mix-blend-mode: multiply;
  filter: none;
  opacity: 0.68;
  animation: none;
}

html[data-theme="light"] .wordmark { color: #282a2d; }
html[data-theme="light"] .wordmark-mark { border-color: #c3bba8; color: #33363a; background: #f3ecdc; }
html[data-theme="light"] .subpage-back-link { color: #55585e; }
html[data-theme="light"] .subpage-back-link:hover,
html[data-theme="light"] .subpage-back-link:focus-visible { color: var(--page-accent); }
html[data-theme="light"] [data-accent] .wordmark-mark {
  border-color: rgba(var(--page-accent-rgb), var(--alpha-accent-strong));
  color: var(--page-accent);
  background: rgba(var(--page-accent-rgb), var(--alpha-soft));
  box-shadow: none;
}
html[data-theme="light"] .home-nav nav a { color: #55585e; }
html[data-theme="light"] .home-nav nav a:hover,
html[data-theme="light"] .home-footer a:hover { color: #111214; }
html[data-theme="light"] .theme-toggle { border-color: #bfc1c5; color: #45484d; }
html[data-theme="light"] .theme-toggle:hover { border-color: #777b81; color: #111214; }

html[data-theme="light"] .home-hero {
  border-color: #c8cacf;

  box-shadow: 0 20px 54px rgba(37, 39, 43, 0.08);
}

html[data-theme="light"] .home-hero h1 span { color: inherit; }
html[data-theme="light"] .home-intro { color: #5f6268; }
html[data-theme="light"] .eyebrow { color: #666a70; }
html[data-theme="light"] .status-dot { background: #6d7075; box-shadow: none; }
html[data-theme="light"] .button-bright { color: #f5f5f6; background: #292b2e; }
html[data-theme="light"] .button-bright:hover { background: #111214; }
html[data-theme="light"] .button-glass { border-color: #bfc1c5; color: #34373b; background: rgba(255, 255, 255, 0.32); }
html[data-theme="light"] .button-glass:hover { border-color: #85888e; background: rgba(255, 255, 255, 0.65); }
html[data-theme="light"] .orbit-ring { border-color: rgba(64, 67, 72, 0.2); }
html[data-theme="light"] .ring-b { border-color: rgba(64, 67, 72, 0.13); }
html[data-theme="light"] .orbit-core { border-color: #aeb1b6; color: #3e4145; background: linear-gradient(145deg, #f5f5f6, #dfe0e2); box-shadow: none; }
html[data-theme="light"] .orbit-star { color: #6f7277; }
html[data-theme="light"] .orbit-label { color: #777a80; }

html[data-theme="light"] .project-card {
  border-color: #c9cbd0;

}

html[data-theme="light"] .project-body p { color: #5e6268; }
html[data-theme="light"] .project-number { color: #777a80; }
html[data-theme="light"] .text-link { border-color: #b9bcc1; color: #292c30; background: rgba(255, 255, 255, 0.42); }
html[data-theme="light"] .text-link:hover { background: #fff; }
html[data-theme="light"] .home-footer { color: #686b70; }
html[data-theme="light"] .home-footer { border-color: #c8cacf;  box-shadow: none; }
html[data-theme="light"] .home-footer > span:first-child { color: #292c30; }
html[data-theme="light"] .home-footer a { color: #55585e; }

/* Theme changes crossfade the finished page, including its fixed background layers. */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 360ms;
    animation-timing-function: ease-in-out;
  }

  ::view-transition-old(root) { animation-name: theme-fade-out; }
  ::view-transition-new(root) { animation-name: theme-fade-in; }

  @keyframes theme-fade-out { to { opacity: 0; } }
  @keyframes theme-fade-in { from { opacity: 0; } }
}

/* Browsers without View Transitions fade through the incoming palette instead. */
.theme-transition-veil {
  position: fixed !important;
  z-index: 9999 !important;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
}

.theme-transition-veil[data-target-theme="light"] { background: #f4eedf; }
.theme-transition-veil[data-target-theme="dark"] { background: #111214; }
.theme-transition-veil.is-visible { opacity: 0.62; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Use site-surface on section panels, cards, heroes and footers. The nearest
   data-accent supplies the tint, so a project card and its page match automatically.
   Mix equal-alpha colors in one layer: tinting must not increase opacity. */
html[data-theme="light"] {
  --surface-start-rgb: 247, 242, 230;
  --surface-end-rgb: 241, 234, 218;
}

body {
  --surface-background: linear-gradient(150deg,
    color-mix(in srgb,
      rgba(var(--surface-start-rgb), var(--alpha-surface)),
      rgba(var(--page-accent-rgb, var(--surface-start-rgb)), var(--alpha-surface)) var(--surface-tint)),
    color-mix(in srgb,
      rgba(var(--surface-end-rgb), var(--alpha-surface)),
      rgba(var(--page-accent-rgb, var(--surface-end-rgb)), var(--alpha-surface)) var(--surface-tint)) 72%);
}

.site-surface { background: var(--surface-background); }
