/* =========================================================
   Data Drive, Pasindu Suraweera
   Layouts: device frame (>= 810px) and phone pills (< 810px).
   ========================================================= */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/Inter-300.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 300; font-display: swap; src: url("../fonts/Inter-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/Inter-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Days One"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/DaysOne-400.woff2") format("woff2"); }

:root {
  --bg: #050505;          /* page + screen */
  --surface: #1a1a1a;     /* cards */
  --line: #333333;        /* dividers */
  --text: #cccccc;        /* headings */
  --muted: #808080;       /* body copy */
  --muted-2: #7a7a7a;     /* section blurbs */
  --body: #a0a0a0;        /* project write-ups */
  --accent: #66ff82;      /* green */
  --glow: radial-gradient(50% 50% at 50% 50%, rgba(140, 255, 122, 0.3) 0%, rgba(138, 255, 120, 0) 100%);
  --spring: cubic-bezier(0.22, 1.2, 0.36, 1);

  --device-w: 600px;
  --screen-w: 544px;
  --content-w: 496px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Inter Placeholder", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
button, input, textarea { font: inherit; color: inherit; }

.icon { width: 16px; height: 16px; flex: none; fill: currentColor; display: block; }
.icon-14 { width: 14px; height: 14px; }
.icon-20 { width: 20px; height: 20px; }

/* tap feedback used across the site */
.press { transition: transform 0.35s var(--spring); }
.press:active { transform: scale(0.96); }

/* =========================================================
   Background ticker (desktop/tablet only)
   ========================================================= */
.bg-ticker {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: clip;
  pointer-events: none;
}
.bg-ticker__field {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2800px;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) rotate(-10deg);
}
.bg-ticker__row {
  height: 46px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.bg-ticker__row--band { background: rgb(22, 22, 22); }
.bg-ticker__track {
  display: flex;
  align-items: center;
  gap: 36px;
  flex: none;
  will-change: transform;
}
.bg-ticker__track span {
  flex: none;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  color: rgb(46, 46, 46);
}
.bg-ticker__row--band span { color: rgb(8, 8, 8); }

/* page content fades when switching pages (see main.js, part 4) */
main.page { transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease; }
main.page.page--out { opacity: 0; transform: translateY(-10px) scale(0.99); filter: blur(4px); }
main.page.page--in { animation: page-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(14px) scale(0.99); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  main.page, main.page.page--in { transition: none; animation: none; }
  main.page.page--out { transform: none; filter: none; }
}

/* the device screen itself, so page switches fade to black instead of showing the background */
@media (min-width: 810px) {
  body::before {
    content: "";
    position: fixed;
    top: 96px;
    bottom: 144px;
    left: 50%;
    width: var(--screen-w);
    transform: translateX(-50%);
    background: var(--bg);
    z-index: 1;
  }
}

/* boot screen: covers the device screen on the first visit (see main.js part 8) */
.boot { display: none; }
.booting .boot {
  position: fixed;
  top: 96px;
  bottom: 144px;
  left: 50%;
  width: var(--screen-w);
  transform: translateX(-50%);
  z-index: 2;
  display: block;
  padding: 44px 26px 20px;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.35s ease;
  /* if the script never runs, don't hide the site */
  animation: boot-failsafe 0s linear 6s forwards;
}
.booting .boot.boot--done { opacity: 0; }
.booting body { overflow: hidden; }
@keyframes boot-failsafe { to { visibility: hidden; } }
.boot__log {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: #8a8a8a;
  white-space: pre-wrap;
}
.boot__log b { font-weight: 400; color: var(--text); }
.boot__log .ok { color: var(--accent); }
.boot__cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   Device frame
   ========================================================= */
.mask { position: fixed; left: 0; right: 0; height: 24px; background: var(--bg); z-index: 3; }
.mask--top { top: 0; }
.mask--bottom { bottom: 0; }
/* laptops and desktops: show everything at 110% (easier to read).
   Change 1.1 to 1 to turn this off. */
@media (min-width: 1024px) and (min-height: 720px) { html { zoom: 1.1; } }
/* on desktop main.js trims the content at these edges instead, so the background stays visible */
@media (min-width: 810px) { .mask { display: none; } }

.device-top {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--device-w);
  height: 92px;
  padding: 4px 4px 0;
  background: linear-gradient(180deg, #525252 0%, #424242 100%);
  border-radius: 28px 28px 0 0;
  z-index: 4;
  display: flex;
}
.device-top__inner {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #424242 0%, #383838 100%);
  border-radius: 24px 24px 0 0;
}
.device-top__row { flex: 1; display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-family: "Days One", sans-serif;
  font-size: 28px;
  line-height: 1.2;
  background: linear-gradient(0deg, #050505 0%, #292929 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.socials { display: flex; gap: 6px; align-items: center; }
.social {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: #1f1f1f;
}
.social__outer {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 8px;
  background: linear-gradient(180deg, #525252 0%, #2e2e2e 100%);
}
.social__inner {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #424242 0%, #383838 98.56%);
}
.social .icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--text);
}

.device-sides {
  position: fixed;
  top: 96px;
  bottom: 144px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--device-w);
  display: flex;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}
.device-sides__rail { width: 28px; display: flex; background: linear-gradient(180deg, #424242 0%, #333333 100%); }
.device-sides__rail--left { justify-content: flex-end; }
.device-sides__rail::before { content: ""; width: 24px; background: linear-gradient(180deg, #383838 0%, #292929 100%); }

.device-bottom {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--device-w);
  height: 120px;
  padding: 0 4px 4px;
  background: linear-gradient(180deg, #333333 0%, #1a1a1a 100%);
  border-radius: 0 0 28px 28px;
  z-index: 9;
  display: flex;
}
.nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  background: linear-gradient(180deg, #292929 0%, #1f1f1f 100%);
  border-radius: 0 0 24px 24px;
}
.nav__btn {
  display: flex;
  padding: 2px;
  border-radius: 14px;
  background: var(--bg);
}
.nav__outer {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 2px;
  border-radius: 12px;
  background: linear-gradient(180deg, #383838 0%, #1f1f1f 100%);
}
.nav__inner {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(180deg, #2e2e2e 0%, #1f1f1f 98.56%);
}
.nav__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.led { position: relative; width: 6px; height: 6px; border-radius: 12px; background: var(--bg); }
.led::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 48px;
  background: var(--glow);
  opacity: 0;
}
.led--on, .nav__btn[aria-current="page"] .led { background: var(--accent); }
.led--on::after, .nav__btn[aria-current="page"] .led::after { opacity: 1; }
.nav__label-group { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.nav__label { font-size: 12px; line-height: 1.2; color: var(--text); }

/* =========================================================
   Page column (the "screen")
   ========================================================= */
.page {
  position: relative;
  z-index: 1;
  width: var(--screen-w);
  min-height: 100vh;
  margin: 0 auto;
  padding: 140px 24px 168px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}
.page--home { gap: 44px; }
.page > * { width: 100%; }
.page--detail { align-items: flex-start; }

/* shared typography */
.h1 { font-size: 24px; font-weight: 500; line-height: 1.2; color: var(--text); }
.h2 { font-size: 18px; font-weight: 500; line-height: 1.2; color: var(--text); }
.h3 { font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--text); }
.small { font-size: 12px; font-weight: 300; line-height: 1.2; color: var(--muted); }
.copy { font-size: 14px; font-weight: 300; line-height: 1.2; color: var(--muted); }

.page-header { display: flex; flex-direction: column; gap: 12px; }

.section { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.section > * { width: 100%; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .h2 { flex: none; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title--plain::after { display: none; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto !important;
  align-self: flex-end;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--muted);
}
.link-btn .icon { width: 14px; height: 14px; }
.link-btn--start { align-self: flex-start; }

/* green / dark buttons */
.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}
.btn--primary { background: var(--accent); color: var(--bg); }

/* availability pill */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
}

/* =========================================================
   Profile header (home + about)
   ========================================================= */
.profile { display: flex; flex-direction: column; gap: 24px; }
.profile__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.profile__id { display: flex; align-items: center; gap: 6px; }
.profile__avatar { width: 77px; height: 77px; border-radius: 50%; object-fit: cover; flex: none; }
.page--about .profile__avatar { width: 86px; height: 86px; }
.profile__text { display: flex; flex-direction: column; }
.profile__bio { display: flex; flex-direction: column; gap: 12px; }
.profile__bio p { font-size: 16px; font-weight: 300; font-style: italic; line-height: 1.2; color: var(--muted); text-align: center; }

/* =========================================================
   Project cards
   ========================================================= */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { display: flex; flex-direction: column; padding: 2px; border-radius: 6px; background: var(--surface); }
.card__media { position: relative; aspect-ratio: 1 / 1; border-radius: 4px; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media picture { display: block; width: 100%; height: 100%; }
.media__item picture, picture.media__item img { display: block; width: 100%; height: 100%; }
.pills { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 3px; }
.pill { padding: 4px; border-radius: 12px; background: var(--bg); color: var(--accent); font-size: 9px; line-height: 1.1; white-space: nowrap; }
.card__body { padding: 12px; }

/* =========================================================
   Stack tiles (home + about)
   ========================================================= */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { display: flex; align-items: center; justify-content: center; height: 94px; border-radius: 6px; background: var(--surface); }
.tile img { width: 70px; height: 70px; border-radius: 6px; }

/* Let's Talk */
.talk {
  position: relative;
  display: block;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.talk span {
  position: absolute;
  left: 50%;
  white-space: nowrap;
  line-height: 1.2;
  transition: top 0.5s var(--spring), font-size 0.5s var(--spring), transform 0.5s var(--spring);
}
.talk__q { top: 50%; font-size: 36px; transform: translate(-50%, -50%); }
.talk__a { top: 100%; font-size: 24px; transform: translate(-50%, 0); }
@media (hover: hover) and (min-width: 810px) {
  .talk:hover .talk__q { top: -14px; font-size: 12px; transform: translate(-50%, -100%); }
  .talk:hover .talk__a { top: 50%; font-size: 64px; transform: translate(-50%, -50%); }
}

/* Footer */
.footer { flex: 1; min-height: 37px; display: flex; flex-direction: column; justify-content: flex-end; animation: footer-in 0.7s var(--spring) both; transform-origin: 50% 50%; }
.footer p { font-size: 14px; font-weight: 300; line-height: 1.2; color: var(--muted); }
@keyframes footer-in { from { opacity: 0.001; transform: scale(0.8); } to { opacity: 1; transform: none; } }

/* =========================================================
   About
   ========================================================= */
.timeline { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.entry { display: flex; gap: 6px; align-items: stretch; }
.entry:has(.entry__logo) { gap: 12px; }
.entry:has(.entry__logo) .entry__rail { width: 28px; gap: 10px; }
.entry__logo { display: block; width: 28px; height: 28px; margin-top: 2px; border-radius: 7px; background: #282828; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07); }
.entry__rail { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; color: var(--muted); }
.entry__rail::after { content: ""; flex: 1; width: 1px; background: var(--muted); }
.timeline > li:last-child .entry__rail::after { display: none; }
.entry__text { flex: 1; display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.timeline > li:last-child .entry__text { padding-bottom: 0; }
.entry__desc { padding-top: 6px; font-size: 14px; font-weight: 300; line-height: 1.2; color: var(--muted); }

.photo { display: block; border-radius: 6px; overflow: clip; flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-row { display: flex; gap: 10px; }
.photo-stack { display: flex; flex-direction: column; gap: 10px; }
.photo-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.photo-scroller::-webkit-scrollbar { display: none; }
.photo-scroller img { -webkit-user-drag: none; user-select: none; }
.photo-scroller.is-dragging { cursor: grabbing; }

/* arrow buttons + drag for mouse users (phones just swipe) */
.scroller-wrap { position: relative; }
.scroller-btn { display: none; }
@media (hover: hover) and (pointer: fine) {
  .photo-scroller { cursor: grab; }
  .scroller-btn {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    padding: 0;
    border: 1px solid #3a3a3a;
    border-radius: 50%;
    background: rgba(18, 18, 18, 0.88);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
  }
  .scroller-btn:hover { background: #262626; }
  .scroller-btn--prev { left: 8px; }
  .scroller-btn--next { right: 8px; }
  .scroller-wrap:hover .scroller-btn:not([hidden]) { opacity: 1; }
  .scroller-btn[hidden] { display: flex; opacity: 0 !important; pointer-events: none; }
}

/* =========================================================
   Projects page
   ========================================================= */
.project-groups { display: flex; flex-direction: column; gap: 48px; }
.project-group { display: flex; flex-direction: column; gap: 12px; }
.project-group__blurb { font-size: 12px; font-weight: 300; line-height: 1.2; letter-spacing: -0.02em; color: var(--muted-2); }

/* =========================================================
   Project detail
   ========================================================= */
.detail-header { display: flex; flex-direction: column; gap: 24px; }
.detail-header .h1 { text-align: left; }
.detail-title { display: flex; flex-direction: column; gap: 24px; }
.detail-media { aspect-ratio: 1 / 1; padding: 2px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
/* illustration + screenshot switcher on project pages (main.js part 10) */
.media { display: block; }
.media__stage { position: relative; aspect-ratio: 1 / 1; padding: 2px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.media__item { position: absolute; inset: 2px; display: block; border-radius: 4px; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.media__item.is-active { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.media__item, .media__item img { width: calc(100% - 0px); height: 100%; }
.media__item img, img.media__item { object-fit: cover; }
.media__switch {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
}
.media__opt {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.media__opt:hover { color: var(--text); }
.media__opt[aria-selected="true"] { background: #262626; color: var(--text); }
.media__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.detail-actions { display: flex; gap: 12px; }
.detail-body { padding-top: 14px; }
.detail-body p { font-size: 15px; font-weight: 400; line-height: 1.55; letter-spacing: -0.02em; color: var(--body); }
.detail-body p + p { margin-top: 14px; }

/* =========================================================
   Stack page
   ========================================================= */
.stack-list { display: flex; flex-direction: column; gap: 12px; }
.stack-card { display: flex; flex-direction: column; gap: 12px; padding: 12px 24px 24px 12px; border-radius: 6px; background: var(--surface); }
.stack-card__head { display: flex; gap: 6px; align-items: flex-start; }
.stack-card__head img { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; flex: none; }
.stack-card__head div { display: flex; flex-direction: column; gap: 2px; }
.stack-card__desc { padding-left: 26px; }

/* =========================================================
   Contact
   ========================================================= */
.contact-block { display: flex; flex-direction: column; gap: 12px; }
.contact-link { display: inline-flex; align-items: flex-end; gap: 6px; font-size: 14px; font-weight: 300; line-height: 1.2; color: var(--muted); width: fit-content; }
.contact-link .icon { color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; border-radius: 6px; background: var(--surface); overflow: hidden; }
.field input, .field textarea {
  flex: 1;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 18px;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
}
.field textarea { height: 137px; resize: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.form__submit {
  height: 55px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.form__submit[disabled] { opacity: 0.6; cursor: default; }
.form__status { font-size: 14px; font-weight: 300; color: var(--muted); text-align: center; }
.form__status:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================
   Centered screens (404, licensing)
   ========================================================= */
.center-screen {
  position: absolute;
  inset: 116px 0 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 1;
}
.notfound__big { font-size: 120px; font-weight: 700; line-height: 1.2; color: var(--surface); }
.notfound__text { width: 220px; text-align: center; }
.notfound__text p + p { margin-top: 20px; }
.notfound .btn { flex: none; width: 161px; }
/* projects: GitHub activity (filled in by main.js part 9) */
.gh__graph { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 6px; background: var(--surface); }
.gh__grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 2px; min-height: 60px; }
.gh__grid i, .gh__legend i { display: block; aspect-ratio: 1 / 1; border-radius: 2px; background: #262626; }
.gh__grid i.pad { visibility: hidden; }
.gh__grid i[data-l="1"], .gh__legend i[data-l="1"] { background: rgba(102, 255, 130, 0.22); }
.gh__grid i[data-l="2"], .gh__legend i[data-l="2"] { background: rgba(102, 255, 130, 0.42); }
.gh__grid i[data-l="3"], .gh__legend i[data-l="3"] { background: rgba(102, 255, 130, 0.68); }
.gh__grid i[data-l="4"], .gh__legend i[data-l="4"] { background: var(--accent); }
.gh__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gh__total { color: var(--muted); }
.gh__legend { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.gh__legend i { width: 9px; }
.gh--failed .gh__graph { display: none; }

/* home: chat button next to "More about Me" */
.profile__actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.profile__actions .link-btn { align-self: center; }
.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.chat-btn .icon { color: var(--accent); }
.chat-btn:hover { background: #222; }

/* project pages: architecture diagram */
.arch { margin: 0; display: flex; flex-direction: column; gap: 22px; }
.arch__flow { display: flex; flex-direction: column; align-items: stretch; }
.arch__flow-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.arch__row { display: flex; gap: 8px; }
.arch__node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #2b2b2b;
  border-radius: 6px;
  background: #111;
}
.arch__node--planned { border-style: dashed; background: transparent; }
.arch__title { font-size: 13px; font-weight: 500; line-height: 1.25; color: var(--text); overflow-wrap: anywhere; }
.arch__sub { font-size: 11.5px; font-weight: 300; line-height: 1.35; color: var(--muted); }
.arch__link { display: grid; grid-template-columns: 1fr 1px 1fr; min-height: 30px; }
.arch__line { position: relative; grid-column: 2; background: #444; }
.arch__line::after {
  content: "";
  position: absolute;
  left: -3.5px;
  bottom: 0;
  border: 4px solid transparent;
  border-top: 5px solid #666;
  border-bottom: 0;
}
.arch__link--both .arch__line::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 0;
  border: 4px solid transparent;
  border-bottom: 5px solid #666;
  border-top: 0;
}
.arch__label {
  grid-column: 3;
  align-self: center;
  padding: 6px 0 6px 12px;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.25;
  color: var(--muted);
}
.arch__group {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
}
.arch__group-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}
.arch__group .arch__row + .arch__row { margin-top: 8px; }
.arch__note { margin: 10px 0 0; font-size: 11px; font-weight: 300; color: var(--muted); text-align: center; }

/* =========================================================
   Phone (< 810px)
   ========================================================= */
@media (max-width: 809.98px) {
  .bg-ticker, .device-sides { display: none; }

  .mask { height: 84px; }

  .device-top {
    left: 24px;
    right: 24px;
    width: auto;
    height: 88px;
    transform: none;
    padding: 4px;
    border-radius: 28px;
    background: linear-gradient(180deg, #525252 0%, #333333 100%);
  }
  .device-top__inner { padding: 20px; border-radius: 24px; }
  .logo { font-size: 22px; }

  .device-bottom {
    left: 24px;
    right: 24px;
    width: auto;
    height: 88px;
    transform: none;
    padding: 4px;
    border-radius: 28px;
  }
  .nav { padding: 20px; border-radius: 24px; }
  .nav__btn { border-radius: 10px; }
  .nav__outer { width: 36px; height: 36px; border-radius: 8px; }
  .nav__inner { border-radius: 6px; }
  .nav__content { gap: 4px; }
  .nav__label { display: none; }

  .page {
    width: 100%;
    padding: 136px 48px;
  }
  .page--detail { padding: 140px 72px 168px; }

  .page-header { align-items: center; text-align: center; }
  .section { align-items: center; }
  .section .link-btn { align-self: center; }

  .profile__top { flex-direction: column; align-items: center; gap: 12px; }
  .profile__id { flex-direction: column; gap: 6px; text-align: center; }
  .profile__text { align-items: center; }
  .profile .link-btn { align-self: center; }
  .profile__actions { flex-direction: column; }
  .booting .boot { top: 0; right: 0; bottom: 0; left: 0; width: auto; transform: none; padding: 120px 28px 20px; }
  .gh__meta { flex-direction: column; align-items: flex-start; }
  .arch__row { flex-wrap: wrap; }
  .arch__node { flex: 1 1 calc(50% - 4px); }
  .page--detail .arch__flow-title { text-align: center; }

  .cards { grid-template-columns: 1fr; }
  .project-groups .cards { gap: 22px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile { height: 84.5px; }
  .tile img { width: 61px; height: 61px; }
  .tile--desktop { display: none; }

  .talk__q { font-size: 24px; }

  .footer { min-height: 82px; padding-bottom: 23px; align-items: center; text-align: center; }

  .photo--edu { height: 148px !important; }
  .photo-scroller .photo { height: 160px !important; }
  .photo-row--fellow .photo { height: 98px !important; }
  .photo--podcast { height: 150px !important; }

  .detail-actions { flex-direction: column; }
  .detail-actions .btn { flex: none; }
  .page--detail .section-title { justify-content: center; text-align: center; }

  .contact-block { align-items: center; }

  .center-screen { position: static; inset: auto; }
}
