:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-line: rgba(25, 118, 210, 0.08);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: #eef3f9;
  --ink: #0f1720;
  --muted: #4f5b68;
  --line: rgba(15, 23, 32, 0.09);
  --blue: #1976d2;
  --blue-soft: #e3f2fd;
  --blue-strong: #0d47a1;
  --shadow-rest: 0 1px 3px rgba(15, 23, 32, 0.08), 0 14px 34px rgba(15, 23, 32, 0.08);
  --shadow-hover: 0 8px 20px rgba(25, 118, 210, 0.14), 0 24px 54px rgba(15, 23, 32, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shell-width: min(1440px, calc(100% - 32px));
  --pointer-x: 50%;
  --pointer-y: 26%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(25, 118, 210, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(13, 71, 161, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.backdrop__spotlight,
.backdrop__mesh {
  position: absolute;
  inset: 0;
}

.backdrop__spotlight {
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(25, 118, 210, 0.14), transparent 22%);
  transition: background-position 140ms linear;
}

.backdrop__mesh {
  background-image:
    linear-gradient(var(--bg-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.66), transparent 92%);
}

.app-bar {
  position: relative;
  z-index: 1;
  width: var(--shell-width);
  margin: 0 auto;
  padding: 14px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.app-bar__eyebrow,
.section-heading__eyebrow,
.project-card__eyebrow,
.social-card__kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}

.app-bar__title {
  margin: 4px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel__chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
}

.panel__chip--ghost {
  background: rgba(15, 23, 32, 0.05);
  color: var(--muted);
}

.shell {
  position: relative;
  z-index: 1;
  width: var(--shell-width);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.shell--horizontal-sections {
  scroll-behavior: smooth;
}

.material-card {
  min-height: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-rest);
}

.presence-card,
.panel {
  padding: 20px;
}

h2,
h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 2.7vw, 2.4rem);
  line-height: 1;
}

h3 {
  font-size: 1.16rem;
  line-height: 1.2;
}

.panel__action,
.project-card__link,
.social-card__cta {
  will-change: transform;
}

.section-heading p,
.panel__heading p,
.project-card__description,
.social-card p,
.footer p,
.project-card__status {
  color: var(--muted);
}

.panel__action,
.project-card__link,
.social-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.panel__action:hover,
.project-card__link:hover,
.social-card:hover .social-card__cta {
  transform: translateY(-1px);
}

.panel__action,
.project-card__link,
.social-card__cta {
  background: transparent;
  color: var(--blue);
  border: 1px solid rgba(25, 118, 210, 0.22);
}


.section-heading {
  display: grid;
  gap: 8px;
}

.section-heading--compact {
  margin-bottom: 14px;
}

.section-heading p,
.panel__heading p {
  margin: 0;
  line-height: 1.55;
}

.presence-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.social-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 3px;
}

.social-scroll::-webkit-scrollbar {
  width: 8px;
}

.social-scroll::-webkit-scrollbar-thumb {
  background: rgba(25, 118, 210, 0.2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.social-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 32, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.social-card--genealogy {
  background:
    linear-gradient(135deg, rgba(25, 118, 210, 0.08), rgba(227, 242, 253, 0.92)),
    #ffffff;
}

.social-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(25, 118, 210, 0.18);
}

.social-card__icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
}

.social-card__glyph {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.social-card__icon--flickr {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 32, 0.08);
}

.social-card__glyph--flickr {
  width: 26px;
  height: 12px;
}

.social-card__icon--instagram {
  background: linear-gradient(135deg, #f58529, #feda77 30%, #dd2a7b 62%, #8134af 82%, #515bd4);
  color: #ffffff;
}

.social-card__glyph--instagram {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-card__icon--linkedin {
  background: #0a66c2;
  color: #ffffff;
}

.social-card__icon--github {
  background: #111827;
  color: #ffffff;
}

.social-card__glyph--github {
  width: 24px;
  height: 24px;
}

.social-card__icon--genealogy {
  background: linear-gradient(135deg, #1976d2, #26a69a);
  color: #ffffff;
}

.social-card__glyph--genealogy {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-card__glyph--genealogy circle {
  fill: currentColor;
  stroke: none;
}

.social-card h3,
.social-card p {
  margin: 0;
}

.social-card__cta::after,
.panel__action::after,
.project-card__link::after {
  content: ">";
  margin-left: 8px;
  font-weight: 700;
}

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

.panel__header,
.panel__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel__heading {
  display: grid;
  gap: 6px;
}

.panel__body {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.panel__body::-webkit-scrollbar {
  width: 10px;
}

.panel__body::-webkit-scrollbar-thumb {
  background: rgba(25, 118, 210, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.flickr-grid {
  display: block;
  column-count: 2;
  column-gap: 10px;
}

.flickr-tile {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid rgba(15, 23, 32, 0.05);
  break-inside: avoid;
  margin-bottom: 10px;
}

.flickr-tile--loading {
  display: grid;
  grid-template-rows: 1fr auto;
}

.flickr-tile__image-shell {
  background:
    linear-gradient(135deg, rgba(25, 118, 210, 0.14), rgba(255, 255, 255, 0.84)),
    linear-gradient(90deg, rgba(15, 23, 32, 0.03), rgba(15, 23, 32, 0.07));
  animation: pulse 1.8s ease-in-out infinite;
}

.flickr-tile__caption {
  padding: 12px;
  font-size: 0.86rem;
}

.flickr-tile__caption p {
  margin: 0;
  line-height: 1.5;
}

.flickr-photo {
  display: block;
  aspect-ratio: calc(var(--photo-width) / var(--photo-height));
  min-height: 148px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.flickr-photo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.flickr-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.projects-grid {
  display: grid;
  gap: 10px;
}

.browser-scripts-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.project-card__topline,
.project-card__meta,
.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.project-card__description {
  margin: 0;
  line-height: 1.45;
  font-size: 0.94rem;
}

.project-card__status {
  font-size: 0.8rem;
}

.project-card__pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(25, 118, 210, 0.08);
  color: var(--blue-strong);
  font-size: 0.78rem;
  font-weight: 500;
}

.footer {
  position: relative;
  z-index: 1;
  width: var(--shell-width);
  margin: 0 auto;
  padding: 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
}

.footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay {
  transition-delay: 80ms;
}

.reveal--delay-2 {
  transition-delay: 140ms;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}

@media (min-width: 1100px) and (min-height: 760px) {
  html,
  body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .shell--horizontal-sections {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding-bottom: 8px;
    padding-right: 12px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 8px;
  }

  .shell--horizontal-sections::before,
  .shell--horizontal-sections::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 8px;
    width: 72px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
    z-index: 2;
  }

  .shell--horizontal-sections::before {
    left: 0;
    background: linear-gradient(90deg, rgba(244, 247, 251, 0.98), rgba(244, 247, 251, 0));
  }

  .shell--horizontal-sections::after {
    right: 0;
    background: linear-gradient(270deg, rgba(244, 247, 251, 0.98), rgba(244, 247, 251, 0));
  }

  .shell--horizontal-sections[data-rail-can-scroll="true"][data-rail-at-start="false"]::before {
    opacity: 1;
  }

  .shell--horizontal-sections[data-rail-can-scroll="true"][data-rail-at-end="false"]::after {
    opacity: 1;
  }

  .shell--horizontal-sections::-webkit-scrollbar {
    height: 12px;
  }

  .shell--horizontal-sections::-webkit-scrollbar-thumb {
    background: rgba(25, 118, 210, 0.2);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
  }

  .shell--horizontal-sections > .material-card {
    width: clamp(320px, 30vw, 430px);
    max-width: calc(100vw - 96px);
    height: 100%;
    min-height: 0;
    scroll-snap-align: start;
  }

  .shell--horizontal-sections > .presence-card {
    width: clamp(360px, 31vw, 430px);
  }

  .presence-card {
    overflow: visible;
  }

  .shell--horizontal-sections > .panel--flickr,
  .shell--horizontal-sections > .panel--projects,
  .shell--horizontal-sections > .panel--browser-scripts {
    overflow: hidden;
  }

  .shell--horizontal-sections > .panel--flickr {
    width: clamp(290px, 24vw, 360px);
  }

  .shell--horizontal-sections > .panel--projects {
    width: clamp(280px, 23vw, 340px);
  }

  .shell--horizontal-sections > .panel--browser-scripts {
    width: clamp(360px, 32vw, 430px);
  }

  .shell--horizontal-sections > .panel {
    min-height: 0;
  }

  .shell--horizontal-sections > .panel .panel__body {
    flex: 1;
  }

  .shell--horizontal-sections > .panel--browser-scripts .browser-scripts-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    padding: 12px;
    gap: 8px;
  }

  .project-card__description {
    font-size: 0.86rem;
  }

  .project-card__topline,
  .project-card__meta,
  .project-card__actions {
    gap: 6px;
  }
}

@media (max-width: 1099px) {
  .shell {
    padding-bottom: 16px;
  }
}

@media (max-width: 900px) {
  .app-bar,
  .footer {
    width: min(100% - 24px, 720px);
  }

  .shell {
    width: min(100% - 24px, 720px);
    grid-template-columns: 1fr;
  }

  .app-bar,
  .panel__header,
  .panel__meta,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .social-grid,
  .flickr-grid {
    column-count: 1;
  }

  .browser-scripts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .backdrop {
    display: none;
  }

  .material-card {
    backdrop-filter: none;
  }

  .reveal,
  .project-card,
  .flickr-photo,
  .social-card,
  .panel__action,
  .social-card__cta,
  .project-card__link {
    transition: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 560px) {
  .app-bar,
  .shell,
  .footer {
    width: calc(100% - 20px);
  }

  .presence-card,
  .panel {
    padding: 18px;
  }

  .panel__action {
    width: 100%;
  }
}
