/* src/styles/subbu.css */
:root {
  --paper: #f7f5ef;
  --ink: #101014;
  --muted: #67645e;
  --line: #d8d3c8;
  --panel: #fffdf7;
  --red: #df271f;
  --blue: #0d4f78;
  --amber: #d99621;
  --black: #050505;
  --grid-x: rgba(16, 16, 20, 0.055);
  --grid-y: rgba(16, 16, 20, 0.045);
  --nav-bg: rgba(247, 245, 239, 0.88);
  --soft-panel: rgba(255, 253, 247, 0.74);
  --role: #25211c;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #11100d;
  --ink: #f2eee5;
  --muted: #b4ac9d;
  --line: #39352f;
  --panel: #191713;
  --red: #ff5a4f;
  --blue: #69b7dd;
  --amber: #f0b640;
  --black: #f2eee5;
  --grid-x: rgba(242, 238, 229, 0.06);
  --grid-y: rgba(242, 238, 229, 0.045);
  --nav-bg: rgba(17, 16, 13, 0.88);
  --soft-panel: rgba(25, 23, 19, 0.76);
  --role: #f2eee5;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--grid-x) 1px, transparent 1px),
    linear-gradient(180deg, var(--grid-y) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Aptos", "Segoe UI", sans-serif;
  line-height: 1.5;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.93rem;
  font-weight: 700;
}

.mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--panel);
  background: var(--black);
  border-radius: 2px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid transparent;
}

.navlinks a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel);
}

.theme-toggle {
  width: 44px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--panel);
  border-color: var(--ink);
}

.theme-toggle .moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon {
  display: block;
}

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: stretch;
  gap: 28px;
  padding: 36px 0 30px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 0;
}

.kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--red);
  border-radius: 50%;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3.7rem, 10vw, 8.8rem);
  line-height: 0.86;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.role {
  margin: 22px 0 0;
  max-width: 660px;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.35;
  color: var(--role);
}

.summary {
  max-width: 660px;
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--black);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--black);
  color: var(--panel);
}

.button.secondary {
  color: var(--black);
  background: transparent;
}

.portrait-frame {
  --portrait-tilt-x: 0deg;
  --portrait-tilt-y: 0deg;
  min-height: 560px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  border: 1px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(13, 79, 120, 0.15) 46% 54%, transparent 54%),
    var(--panel);
  perspective: 900px;
}

.portrait-frame::before,
.portrait-frame::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transition: transform 220ms ease;
}

.portrait-frame::before {
  width: 170px;
  height: 170px;
  left: 30px;
  top: 32px;
  background: var(--red);
  border-radius: 50%;
  opacity: 0.92;
}

.portrait-frame::after {
  width: 150px;
  height: 210px;
  right: 38px;
  bottom: 90px;
  background: rgba(217, 150, 33, 0.84);
  opacity: 0.82;
}

.portrait-frame img {
  width: min(78%, 500px);
  aspect-ratio: 1;
  min-height: 0;
  height: auto;
  object-fit: cover;
  object-position: center 18%;
  filter: grayscale(0.04) contrast(1.08) brightness(1.02);
  position: relative;
  z-index: 2;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    0 0 0 14px var(--panel),
    0 0 0 15px var(--ink),
    18px 24px 0 color-mix(in srgb, var(--blue) 28%, transparent);
  transform: rotateX(var(--portrait-tilt-x)) rotateY(var(--portrait-tilt-y));
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
  cursor: pointer;
}

.portrait-frame:hover img {
  filter: grayscale(0) contrast(1.1) brightness(1.04);
  box-shadow:
    0 0 0 14px var(--panel),
    0 0 0 15px var(--ink),
    24px 30px 0 color-mix(in srgb, var(--red) 34%, transparent);
}

.portrait-frame:hover::before {
  transform: translate(-8px, -10px) scale(1.06);
}

.portrait-frame:hover::after {
  transform: translate(10px, 12px) rotate(3deg);
}

[data-theme="dark"] .portrait-frame {
  background:
    linear-gradient(135deg, transparent 0 46%, color-mix(in srgb, var(--blue) 24%, transparent) 46% 54%, transparent 54%),
    var(--panel);
}

[data-theme="dark"] .portrait-frame img {
  filter: grayscale(0) contrast(1.06) brightness(1.18);
  box-shadow:
    0 0 0 14px var(--panel),
    0 0 0 15px var(--ink),
    18px 24px 0 color-mix(in srgb, var(--blue) 44%, transparent),
    0 24px 60px rgba(0, 0, 0, 0.46);
}

[data-theme="dark"] .portrait-frame:hover img {
  filter: grayscale(0) contrast(1.08) brightness(1.24);
  box-shadow:
    0 0 0 14px var(--panel),
    0 0 0 15px var(--ink),
    24px 30px 0 color-mix(in srgb, var(--amber) 42%, transparent),
    0 24px 60px rgba(0, 0, 0, 0.54);
}

.fallback {
  min-height: 560px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: relative;
  z-index: 3;
  text-align: center;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--muted);
}

.portrait-frame img[src=""] + .fallback {
  display: flex;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  margin-bottom: 24px;
}

.stat {
  position: relative;
  min-height: 106px;
  padding: 16px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--soft-panel);
}

.stat .icon {
  position: absolute;
  right: 15px;
  top: 15px;
  color: var(--red);
}

.stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.88rem;
}

section {
  padding: 50px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.tile {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  min-height: 232px;
  padding: 20px;
  background: var(--panel);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(var(--lift)) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tile,
  .entry,
  .button {
    transition: none;
  }

  .hero-title-svg text,
  .hero-title-svg .accent-line {
    animation: none;
    stroke-dashoffset: 0;
    fill: var(--ink);
  }

  .hero-title-svg .accent-line {
    fill: none;
  }
}

.tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.tile:hover,
.tile:focus-visible {
  --lift: -4px;
  background: var(--soft-panel);
  outline: none;
}

.tile:hover::after,
.tile:focus-visible::after,
.tile.active::after {
  transform: scaleX(1);
}

.tile.active {
  background: var(--black);
  color: var(--panel);
}

.tile.active p,
.tile.active code {
  color: #d9d1c2;
}

.tile-top {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.tile-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

.tile.active .tile-icon {
  color: var(--amber);
  background: rgba(217, 150, 33, 0.14);
}

.tile h3,
.entry h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.tile p,
.entry p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tile code {
  display: inline-block;
  color: var(--red);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  background: transparent;
}

.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.entry {
  min-height: 154px;
  padding: 19px;
  background: var(--panel);
  position: relative;
  transition: background 160ms ease, transform 160ms ease;
}

.entry:hover {
  background: var(--soft-panel);
  transform: translateX(3px);
}

.entry-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--red);
  border: 1px solid currentColor;
}

.entry.full {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  align-items: start;
}

.year {
  font-family: "Consolas", "Courier New", monospace;
  color: var(--blue);
  font-weight: 800;
}

.contact-band {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 28px;
  align-items: end;
  padding-bottom: 72px;
}

.contact-band p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact-list {
  border-top: 1px solid var(--ink);
}

.contact-list a,
.contact-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.contact-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contact-list a:hover {
  color: var(--red);
}

.contact-list small {
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

footer {
  padding: 20px 0 34px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-title-svg {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: 0;
  overflow: visible;
}

.hero-title-svg text {
  font-family: "Aptos", "Segoe UI", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-dasharray: 1320;
  stroke-dashoffset: 1320;
  letter-spacing: -4px;
  animation:
    titleDraw 2.2s ease forwards 0.18s,
    titleFill 0.8s ease forwards 1.95s;
}

.hero-title-svg .accent-line {
  stroke: var(--red);
  stroke-width: 8;
  stroke-linecap: square;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: accentDraw 1.1s ease forwards 1.45s;
}

@keyframes titleDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes titleFill {
  to {
    fill: var(--ink);
  }
}

@keyframes accentDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Particle background layer: keeps the existing theme and sits behind content */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

@media (max-width: 960px) {
  .hero,
  .contact-band,
  .section-head {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  h1 {
    max-width: 100%;
  }

  .hero-title-svg {
    width: min(100%, 680px);
  }

  .portrait-frame,
  .fallback {
    min-height: 460px;
  }

  .portrait-frame img {
    width: min(74%, 430px);
  }

  .stats,
  .grid,
  .stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .navlinks {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 24px;
    gap: 16px;
  }

  .role {
    font-size: 1.06rem;
  }

  .portrait-frame,
  .fallback {
    min-height: 390px;
  }

  .portrait-frame img {
    width: min(72%, 310px);
    box-shadow:
      0 0 0 10px var(--panel),
      0 0 0 11px var(--ink),
      12px 16px 0 color-mix(in srgb, var(--blue) 28%, transparent);
  }

  .portrait-frame:hover img {
    box-shadow:
      0 0 0 10px var(--panel),
      0 0 0 11px var(--ink),
      16px 20px 0 color-mix(in srgb, var(--red) 34%, transparent);
  }

  [data-theme="dark"] .portrait-frame img {
    box-shadow:
      0 0 0 10px var(--panel),
      0 0 0 11px var(--ink),
      12px 16px 0 color-mix(in srgb, var(--blue) 44%, transparent),
      0 20px 44px rgba(0, 0, 0, 0.46);
  }

  [data-theme="dark"] .portrait-frame:hover img {
    box-shadow:
      0 0 0 10px var(--panel),
      0 0 0 11px var(--ink),
      16px 20px 0 color-mix(in srgb, var(--amber) 42%, transparent),
      0 20px 44px rgba(0, 0, 0, 0.54);
  }

  .portrait-frame::before {
    width: 110px;
    height: 110px;
    left: 18px;
    top: 18px;
  }

  .portrait-frame::after {
    width: 96px;
    height: 140px;
    right: 20px;
    bottom: 64px;
  }

  .stats,
  .grid,
  .stack,
  .entry.full {
    grid-template-columns: 1fr;
  }

  section {
    padding: 36px 0;
  }
}
