/*
  src/assets/site.css

  Purpose:
  - Shared stylesheet for the Eleventy-generated site; copied to /assets/site.css in the build.
  - Styles the shell (header/nav/footer), page layout, galleries, videos, about page, and 404.

  Design notes:
  - Light/dark aware via system color-scheme and subtle borders using CanvasText mixes.
  - Grids expect 4:3 imagery; generated thumbs and skeletons match this ratio to prevent jumps.
  - Video embeds use an aspect-ratio wrapper; lite-youtube has a fallback box for poster visibility.
*/

:root {
  color-scheme: light dark;

  /* Global layout tokens reused across pages */
  --max: 1160px;
  --pad: 20px;
  --gap: 16px;
  --radius: 12px;

  /* Subtle borders that respect light/dark system colors */
  --border: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  --border-strong: 1px solid color-mix(in srgb, CanvasText 18%, transparent);

  /* Comfortable reading width for long-form text */
  --text-max: 72ch;

  /* Link hover accent */
  --link-hover: #5aa3ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

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

/* Underline links in body text only (not nav/buttons) */
.p a { text-decoration: underline; }
.h1 a,
.h2 a,
.h3 a,
.h4 a,
.h5 a,
.h6 a {
  text-decoration: underline;
}

.p a:hover,
.h1 a:hover,
.h2 a:hover,
.h3 a:hover,
.h4 a:hover,
.h5 a:hover,
.h6 a:hover {
  color: var(--link-hover);
}

/* Sticky header with dark blur so nav stays legible over photos */
.header {
  position: sticky;
  top: 0;
  z-index: 10000;

  /* Painted layer ensures blur covers underlying content */
  background: rgba(0, 0, 0, 0.7);

  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

/* Light mode: match the page background so the bar doesn't stay dark */
@media (prefers-color-scheme: light) {
  .header {
    background: rgba(255, 255, 255, 0.75);
  }
}


/* Navigation: brand left, links right */
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand { font-weight: 650; }
.nav__links { display: flex; gap: 14px; }

.nav__more {
  position: relative;
}

.nav__more summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.nav__more summary::-webkit-details-marker {
  display: none;
}

.nav__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 12px;
  border: var(--border-strong);
  background: color-mix(in srgb, Canvas 92%, transparent);
  box-shadow: 0 12px 24px color-mix(in srgb, CanvasText 16%, transparent);
  flex-direction: column;
  gap: 8px;
  z-index: 10001;
}

.nav__more[open] .nav__dropdown {
  display: flex;
}

/* Content container */
.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad) 44px;
}

/* Footer container */
.footer {
  border-top: var(--border);
  padding: 22px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
}

/* Utility typography used by templates */
.h1 { font-size: 28px; margin: 0 0 14px; letter-spacing: -0.01em; }
.p { margin: 0 0 16px; max-width: var(--text-max); opacity: 0.92; }
.blog-desc { font-style: italic; }

/* Blog post hero + blog index thumbnail styles */
.blog-post__meta {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 12px;
}

.blog-post__hero {
  margin: 0 0 18px;
  max-width: min(100%, 920px);
}

.blog-post__hero-image {
  width: 100%;
  border-radius: var(--radius);
  border: var(--border);
  display: block;
  object-fit: cover;
}

.blog-post__hero-caption {
  font-style: italic;
  margin: 8px 0 0;
}

.blog-list__item {
  margin: 0 0 18px;
  padding-bottom: 20px;
  border-bottom: var(--border);
}

.blog-list__item:last-child {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-list__title {
  font-size: 20px;
  display: inline-block;
  margin: 0 0 6px;
}

.blog-list__date {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.blog-list__description {
  margin: 0;
}

.blog-list__excerpt {
  margin: 6px 0 0;
}

.blog-list__thumb-link,
.blog-list__thumb {
  display: block;
  width: 100%;
  max-width: min(100%, 720px);
}

.blog-list__thumb {
  margin-top: 10px;
  border-radius: var(--radius);
  border: var(--border);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.blog-list__thumb-caption {
  font-style: italic;
  margin-top: 8px;
}

.blog-list__pager {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Shared responsive grid for album cards and gallery thumbs */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
}

/* Tighter spacing on album pages */
.gallery--album {
  gap: 4px;
}

/* Album card shell on /albums/ */
.card {
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Image thumbnail sizing */
.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Album card label row */
.card__meta {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  opacity: 0.9;
}

/* Clickable gallery tiles (album pages + home gallery) */
.gallery a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
}

/* Lightbox affordance */
.gallery a { cursor: zoom-in; }

/* Visible focus ring for keyboard users */
a:focus-visible {
  outline: 2px solid color-mix(in srgb, CanvasText 60%, transparent);
  outline-offset: 3px;
}

/* Contact spoiler (legacy; no effect if unused) */
.contact {
  margin-top: 28px;
}

.contact__reveal {
  cursor: pointer;
  border: var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: inline-block;
}

.contact__email {
  display: none;
  margin-top: 12px;
  font-weight: 500;
}

.contact[data-open="true"] .contact__email {
  display: block;
}

/* Skeleton placeholders on Home that match 4:3 gallery tiles */
.skeleton {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: var(--border);
  background:
    linear-gradient(
      100deg,
      color-mix(in srgb, CanvasText 6%, transparent) 40%,
      color-mix(in srgb, CanvasText 10%, transparent) 50%,
      color-mix(in srgb, CanvasText 6%, transparent) 60%
    );
}

/* Mobile grid tweaks: denser spacing and fixed 3-up layout */
@media (max-width: 520px) {
  :root {
    --pad: 14px;
    --gap: 8px;
    --radius: 10px;
  }

  .nav__links { gap: 10px; }

  /* Force 3-up grid on small screens */
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Slightly lighter borders on small screens so it feels less “boxed” */
  .gallery a {
    border: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
  }

  .gallery--album {
    gap: 4px;
  }
}

/* Home layout blocks built with grid areas (intro and project) */
.home-intro,
.home-project {
  display: grid;
  gap: var(--gap);
  align-items: start;
  margin-bottom: 22px;
}

/* Intro: text left, image right */
.home-intro {
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-areas: "text media";
}

/* Project: image left, text right */
.home-project {
  grid-template-columns: 0.8fr 1.2fr;
  grid-template-areas: "media text";
}

/* Field note: text left, image right */
.home-fieldnote {
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-areas: "text media";
}

.home-intro__text,
.home-project__text {
  grid-area: text;
}

.home-intro__media,
.home-project__media {
  grid-area: media;
}

.home-h2 {
  font-size: 22px;
  margin-top: 0;
}

.home-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: var(--border);
}

/* Embla carousel (photo pager) */
.embla {
  position: relative;
}

.embla__viewport {
  overflow: hidden;
  border-radius: var(--radius);
  border: var(--border);
  aspect-ratio: 4 / 3;
  min-height: 220px;
  background: rgba(0, 0, 0, 0.06);
}

.embla__container {
  display: flex;
  height: 100%;
}

.embla__slide {
  flex: 0 0 100%;
  position: relative;
  height: 100%;
}

.embla__slide__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.embla__slide__link {
  display: block;
  width: 100%;
  height: 100%;
}

/* CV hero pager: fill the frame to avoid letterboxing */
.about-hero .embla__slide__img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.embla__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}

.embla__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.embla__dot.is-active {
  background: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: light) {
  .embla__dots {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .embla__dot {
    background: rgba(0, 0, 0, 0.35);
  }

  .embla__dot.is-active {
    background: rgba(0, 0, 0, 0.8);
  }

  .embla__viewport {
    background: rgba(0, 0, 0, 0.04);
  }
}

/* Field notes link placement (desktop vs mobile) */
.field-notes-link--mobile {
  display: none;
  margin-top: 10px;
}

.home-media-link {
  margin-top: 10px;
}

.home-media-link--mobile {
  display: none;
}

/* Ensure lite-youtube placeholders inherit the same sizing/border and keep height even if vendor CSS lags */
lite-youtube.home-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border-radius: var(--radius);
  border: var(--border);
  background-size: cover;
  background-position: center;
}

.home-divider {
  border: 0;
  border-top: var(--border);
  margin: 18px 0 22px;
}

/* Running progress block (home) */
.progress-block {
  margin: 0px 0 28px;
  padding: 8px 18px 26px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: var(--border);
}

.progress-block__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.progress-block h2 {
  margin: 0;
  font-size: 18px;
}

.progress-timestamp {
  font-size: 11px;
  opacity: 0.75;
  white-space: normal;
  margin-bottom: 8px;
  text-align: center;
}

.progress-item {
  margin-top: 14px;
}

.progress-spacer {
  height: 12px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.progress-title {
  font-size: 14px;
  letter-spacing: 0.2px;
}

.progress-meta {
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
}

/* 12-month dots */
.tenk-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
}

.tenk-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.tenk-cell.is-exception::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 120ms ease, transform 120ms ease;
}

.tenk-cell.is-exception::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%) translateY(4px);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(20, 20, 20, 0.95);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 120ms ease, transform 120ms ease;
}

.tenk-cell.is-exception:hover::after,
.tenk-cell.is-exception:hover::before,
.tenk-cell.is-exception:focus-visible::after,
.tenk-cell.is-exception:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tenk-dot {
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: 1px solid rgba(255, 255, 255, 0.10);
}

.tenk-dot.is-done {
  background: #6bb6ff;
  outline: 1px solid rgba(107, 182, 255, 0.6);
}

.tenk-dot.is-exception {
  background: #ef4444;
  outline: 1px solid rgba(239, 68, 68, 0.75);
}

.tenk-label {
  font-size: 10px;
  letter-spacing: 0.2px;
  opacity: 0.7;
}

/* Miles bar */
.bar-wrap {
  position: relative;
}

.bar {
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
  outline: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6bdc7d 0%, #7ff09a 50%, #6bdc7d 100%);
  background-size: 220% 100%;
  animation: progress-bar-pulse 2.6s ease-in-out infinite;
}

.bar-fill--elevation {
  background: linear-gradient(90deg, #9b6bff 0%, #b892ff 50%, #9b6bff 100%);
  background-size: 220% 100%;
  animation-duration: 3s;
}

@keyframes progress-bar-pulse {
  0% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
    filter: saturate(1.15);
  }
  100% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
}

.bar-marker {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 24px;
  background: rgba(255, 255, 255, 0.8);
}

.bar-marker--year {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.bar-label {
  margin-top: 6px;
  font-size: 11px;
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  opacity: 0.75;
  white-space: nowrap;
  text-align: center;
}



@media (prefers-color-scheme: light) {
  .progress-block {
    background: rgba(0, 0, 0, 0.02);
  }

  .fitness-metric {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.12);
  }

  .tenk-dot {
    background: rgba(0, 0, 0, 0.10);
    outline: 1px solid rgba(0, 0, 0, 0.12);
  }

  .tenk-dot.is-done {
    background: #6bb6ff;
    outline: 1px solid rgba(41, 123, 255, 0.45);
  }

  .tenk-dot.is-exception {
    background: #ef4444;
    outline: 1px solid rgba(185, 28, 28, 0.6);
  }

  .bar {
    background: rgba(0, 0, 0, 0.10);
    outline: 1px solid rgba(0, 0, 0, 0.12);
  }

  .bar-marker {
    background: rgba(0, 0, 0, 0.6);
  }

  .bar-marker--year {
    background: rgba(0, 0, 0, 0.25);
    box-shadow: none;
  }

}

.bar-sub {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.8;
}

/* Fitness metric cards (fitness page) */
.fitness-metrics {
  margin: 0 0 28px;
}

.fitness-metrics__grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}


.fitness-metrics__note {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 18px;
  text-align: center;
}

.fitness-carousel {
  margin-top: 12px;
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.fitness-carousel .embla__viewport {
  border: 0;
  background: transparent;
  aspect-ratio: auto;
  min-height: auto;
  overflow: hidden;
  padding: 0;
}

.fitness-carousel .embla__container {
  align-items: stretch;
}

.fitness-carousel .embla__slide {
  display: flex;
  justify-content: center;
  padding: 24px 18px;
}

.fitness-carousel .fitness-metric {
  width: min(220px, 100%);
}

.fitness-carousel .embla__dots {
  position: static;
  transform: none;
  margin-top: 12px;
  justify-content: center;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.fitness-carousel-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.fitness-carousel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fitness-carousel-panel .fitness-metrics__note {
  margin-top: 0;
}

@media (max-width: 900px) {
  .fitness-carousel-row {
    grid-template-columns: 1fr;
  }
}

.fitness-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  aspect-ratio: 1 / 1;
  align-items: center;
  text-align: center;
}

.fitness-metric__label {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.fitness-metric__value {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.fitness-metric__comparison {
  font-size: 15px;
  color: #77c7ff;
  opacity: 0.9;
  margin: 0;
}

.fitness-metric__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.2;
  text-align: center;
}

.fitness-metric__status {
  display: none;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #77c7ff;
  margin: 0;
}

.fitness-metric__status.is-active {
  display: block;
}

.fitness-metric--glow {
  border-color: color-mix(in srgb, #77c7ff 80%, transparent);
  box-shadow:
    0 0 16px color-mix(in srgb, #77c7ff 60%, transparent),
    0 0 34px color-mix(in srgb, #77c7ff 45%, transparent);
  animation: fitness-glow 2.4s ease-in-out infinite;
}

@keyframes fitness-glow {
  0% {
    box-shadow:
      0 0 14px color-mix(in srgb, #77c7ff 50%, transparent),
      0 0 28px color-mix(in srgb, #77c7ff 38%, transparent);
  }
  50% {
    box-shadow:
      0 0 22px color-mix(in srgb, #77c7ff 75%, transparent),
      0 0 42px color-mix(in srgb, #77c7ff 55%, transparent);
  }
  100% {
    box-shadow:
      0 0 14px color-mix(in srgb, #77c7ff 50%, transparent),
      0 0 28px color-mix(in srgb, #77c7ff 38%, transparent);
  }
}

/* Apps page */
.apps-page {
  --apps-accent: #ffb457;
  --apps-cool: #5fd0ff;
  --apps-card: rgba(255, 255, 255, 0.04);
}

.apps-hero {
  position: relative;
  padding: 28px;
  border-radius: 18px;
  border: var(--border);
  background:
    radial-gradient(120% 140% at 12% -10%, rgba(95, 208, 255, 0.22) 0%, rgba(95, 208, 255, 0) 55%),
    radial-gradient(120% 140% at 90% 0%, rgba(255, 180, 87, 0.22) 0%, rgba(255, 180, 87, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.18));
  overflow: hidden;
}

.apps-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 9px
  );
  opacity: 0.25;
  pointer-events: none;
}

.apps-hero__badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.apps-hero__title {
  margin: 14px 0 10px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.apps-hero__intro {
  margin: 0 0 16px;
  max-width: 60ch;
  opacity: 0.9;
}

.apps-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apps-shelf {
  margin-top: 28px;
}

.apps-shelf__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.apps-shelf__title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apps-shelf__note {
  margin: 0;
  opacity: 0.7;
}

.apps-shelf__grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.app-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: var(--border);
  background: var(--apps-card);
  text-decoration: none;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.app-card__index {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 12px;
  letter-spacing: 0.3em;
  opacity: 0.5;
}

.app-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #101010;
  background: linear-gradient(135deg, rgba(95, 208, 255, 0.9), rgba(255, 180, 87, 0.8));
  overflow: hidden;
}

.app-card__icon--mac {
  background: linear-gradient(135deg, rgba(255, 180, 87, 0.95), rgba(110, 245, 183, 0.85));
}

.app-card__icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.app-card__title {
  font-size: 18px;
  font-weight: 600;
}

.app-card__subtitle {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.app-card__meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.app-chip--active {
  border-color: rgba(255, 180, 87, 0.8);
  color: #ffd3a3;
}

.app-section {
  margin-top: 26px;
  padding: 22px;
  border-radius: 18px;
  border: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.app-section__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.app-section__eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.6;
}

.app-section__title {
  margin: 6px 0 8px;
  font-size: 26px;
}

.app-section__desc {
  margin: 0;
  max-width: 56ch;
  opacity: 0.85;
}

.app-section__status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.app-section__grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.app-section__card {
  padding: 14px;
  border-radius: 14px;
  border: var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.app-section__card-title {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}

.app-section__card-body {
  font-size: 15px;
}

.app-section__list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.app-section__list li {
  line-height: 1.45;
}

@media (max-width: 720px) {
  .apps-hero {
    padding: 22px;
  }

  .apps-hero__title {
    font-size: 26px;
  }

  .apps-shelf__header {
    align-items: flex-start;
  }

  .app-section__status {
    width: 100%;
  }
}


/* Games */
.game-page {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.game-frame {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: var(--border);
  background: #000;
  overflow: hidden;
}

.game-frame--idle #game {
  visibility: hidden;
}

.game-frame #game {
  width: 100%;
  height: 100%;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.games-embed {
  margin-top: 18px;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: var(--border);
  background: #000;
}

.games-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.game-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  border: var(--border);
  background: color-mix(in srgb, Canvas 92%, transparent);
}

.game-card__title {
  font-size: 18px;
  font-weight: 600;
}

.game-card__meta {
  font-size: 12px;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .fitness-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 520px) {
  .fitness-metrics__grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile: stack text above image */
@media (max-width: 720px) {
  .home-intro,
  .home-project {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "media";
  }

  .field-notes-link {
    display: none;
  }

  .field-notes-link--mobile {
    display: block;
  }

  .home-media-link {
    display: none;
  }

  .home-media-link--mobile {
    display: block;
  }
}

/* Large screens: cap image size so home layout doesn’t feel oversized */
@media (min-width: 1100px) {
  .home-intro__media,
  .home-project__media {
    max-width: 520px;
  }

  .home-intro__media { justify-self: end; }
  .home-project__media { justify-self: start; }

  .home-photo {
    max-width: 520px;
    max-height: 360px;
    object-fit: cover;
  }
}

/* Video sections */

.video-section {
  margin: 3rem 0;
}

/* Video embed container */

.video-embed {
  position: relative;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

/* Thumbnail image before load */

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

/* Play button overlay */

.video-play {
  position: absolute;
  inset: 0;
  background: none;
  border: none;
  cursor: pointer;
}

/* Circle */

.video-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
}

/* Triangle */

.video-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-38%, -50%);
  width: 0;
  height: 0;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
}

/* Iframe once loaded */

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* About page: experience layout */

.role {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.role + .role {
  border-top: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  padding-top: 1rem;
}

.role-promos {
  margin-top: 1.25rem;
  border-left: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  padding-left: 18px;
}

.role-promo {
  position: relative;
  padding-left: 8px;
  margin-bottom: 1.5rem;
}

.role-promo:last-child {
  margin-bottom: 0;
}

.role-promo::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, CanvasText 40%, transparent);
}

.role-promo-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.role-skills {
  font-style: italic;
  opacity: 0.7;
  margin-top: 10px;
}

/* Logo sizing */

.role-logo img {
  max-width: 120px;
  max-height: 80px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Experience section on mobile */

@media (max-width: 600px) {
  .role {
    grid-template-columns: 1fr;
  }

  .role-logo img {
    max-width: 140px;
  }
}

/* About page hero layout */

.about-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3rem;
}

.about-hero-image > img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}

/* About hero on mobile */

@media (max-width: 800px) {
  .about-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about-hero-image {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .about-hero-image > img {
    max-width: 240px;
  }
}

/* Playlist / wide video embeds */

.playlist-embed {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
}

.playlist-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 404 page */

.not-found {
  max-width: 720px;
  margin: 5rem auto 6rem;
  text-align: center;
  padding: 0 1rem;
}

.not-found__image {
  display: block;
  max-width: 540px;
  width: 100%;
  height: auto;
  margin: 0 auto 2rem;
  border-radius: 6px;
}

.not-found__links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.not-found__links a {
  text-decoration: underline;
}

.not-found__links a:hover {
  color: var(--link-hover);
}

/* Solar dashboard */
.energy-shell {
  margin-top: 12px;
  padding: 28px clamp(18px, 3vw, 36px) 34px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  position: relative;
  background:
    radial-gradient(circle at 10% 20%, color-mix(in srgb, #ffe9a5 45%, transparent), transparent 45%),
    radial-gradient(circle at 90% 0%, color-mix(in srgb, #c2f0ff 50%, transparent), transparent 55%),
    linear-gradient(145deg, color-mix(in srgb, Canvas 92%, transparent), color-mix(in srgb, Canvas 78%, transparent));
  box-shadow: 0 24px 60px color-mix(in srgb, CanvasText 12%, transparent);
}

.energy-flow.is-off-grid {
  border-color: color-mix(in srgb, #3dff9f 65%, transparent);
  box-shadow:
    0 16px 36px color-mix(in srgb, CanvasText 12%, transparent),
    0 0 26px color-mix(in srgb, #3dff9f 35%, transparent);
}

.energy-hero {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  margin-top: -6px;
}

.energy-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  opacity: 0.7;
  margin: 0 0 10px;
}

.energy-title {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 4px;
}

.energy-status {
  font-size: 17px;
  margin-bottom: 8px;
  line-height: 1.25;
}

.energy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  opacity: 0.85;
}

.energy-meta--corner {
  position: absolute;
  top: 22px;
  right: 24px;
  justify-content: flex-end;
  text-align: right;
}

.energy-badge {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.energy-badge--ok {
  background: color-mix(in srgb, #d3ffe6 55%, Canvas 45%);
  color: color-mix(in srgb, CanvasText 75%, #0b5b30 25%);
}

.energy-badge--stale {
  background: color-mix(in srgb, #ffe0c2 55%, Canvas 45%);
  color: color-mix(in srgb, CanvasText 70%, #a7500a 30%);
}

.energy-badge--storm {
  background: color-mix(in srgb, #ffe4f1 60%, Canvas 40%);
  color: color-mix(in srgb, CanvasText 70%, #a0064c 30%);
}

.energy-stat-block {
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  padding: 18px 18px 14px;
  background: color-mix(in srgb, Canvas 85%, transparent);
}

.energy-stat-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  opacity: 0.7;
}

.energy-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}


.energy-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  opacity: 0.9;
}

.energy-stat strong {
  font-size: 16px;
}

.energy-flow {
  margin: 26px 0 24px;
  position: relative;
  min-height: 360px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
  background:
    linear-gradient(160deg, color-mix(in srgb, #f5f7ff 70%, Canvas 30%), color-mix(in srgb, #ecfff7 55%, Canvas 45%));
  overflow: hidden;
}

.energy-flow__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #5a9eff;
}

.flow-line {
  fill: none;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-dasharray: 10 14;
  opacity: 0.95;
  filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 18px currentColor);
  animation: flow-dash 1.9s linear infinite, flow-pulse 2.1s ease-in-out infinite;
}

.flow-line--solar { color: #ff9f1c; stroke: url(#flow-glow-solar); animation-delay: 0s, 0.05s; }
.flow-line--grid { color: #4f8cff; stroke: url(#flow-glow-grid); animation-delay: 0.15s, 0.25s; }
.flow-line--battery { color: #20c997; stroke: url(#flow-glow-battery); animation-delay: 0.3s, 0.15s; }

.flow-line.is-reverse {
  animation-direction: reverse;
}

.flow-line.is-idle {
  stroke-dasharray: none;
  opacity: 0.35;
  animation: none;
}

@keyframes flow-dash {
  to { stroke-dashoffset: -24; }
}

@keyframes flow-pulse {
  0% { opacity: 0.35; stroke-width: 3.5; }
  50% { opacity: 1; stroke-width: 7.5; }
  100% { opacity: 0.45; stroke-width: 4.5; }
}

.energy-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 140px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, CanvasText 14%, transparent);
  background: color-mix(in srgb, Canvas 90%, transparent);
  box-shadow: 0 16px 30px color-mix(in srgb, CanvasText 14%, transparent);
}

.energy-node__title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.energy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  font-size: 15px;
  opacity: 0.9;
  background: color-mix(in srgb, Canvas 85%, transparent);
}

.energy-node__value {
  font-size: 20px;
  font-weight: 650;
}

.energy-node__hint {
  font-size: 12px;
  opacity: 0.6;
}

.energy-node--solar {
  left: 20%;
  top: 19%;
  border-color: color-mix(in srgb, #ffb300 40%, transparent);
}

.energy-node--grid {
  left: 80%;
  top: 19%;
  border-color: color-mix(in srgb, #4fa3ff 40%, transparent);
}

.energy-node--battery {
  left: 20%;
  top: 81%;
  border-color: color-mix(in srgb, #35c39a 40%, transparent);
}

.energy-node--house {
  left: 70%;
  top: 56%;
  min-width: 160px;
  background: color-mix(in srgb, #111a2b 8%, Canvas 92%);
  border-color: color-mix(in srgb, #ffffff 20%, transparent);
}

.energy-flow__label {
  position: absolute;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  background: color-mix(in srgb, Canvas 94%, transparent);
  font-size: 12px;
  opacity: 0.85;
}

.energy-flow__label--solar {
  left: 38%;
  top: 34%;
}

.energy-flow__label--grid {
  left: 60%;
  top: 34%;
}

.energy-flow__label--battery {
  left: 36%;
  top: 69%;
}


/* HA-style flow replica */
.ha-flow {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
}

.ha-flow--pair-test {
  padding-top: 0;
  border-top: 0;
}

.ha-flow__header {
  margin-bottom: 16px;
}

.ha-flow__title {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ha-flow__note {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
}

.ha-flow__pair-test {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

.ha-flow__pair-test > .ha-flow__card {
  flex: 1 1 288px;
  max-width: 342px;
}

.ha-flow__card--photo {
  padding: 0;
  overflow: hidden;
}

.ha-flow__card--photo .embla {
  height: 100%;
}

.ha-flow__card--photo .embla__viewport {
  height: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.ha-flow__card--photo .embla__slide__img {
  object-fit: cover;
}

.ha-flow__photo-link {
  display: block;
  width: 100%;
  height: 100%;
}

.ha-flow__photo {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.ha-flow__card {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
  background: color-mix(in srgb, Canvas 96%, transparent);
  box-shadow: 0 18px 36px color-mix(in srgb, CanvasText 10%, transparent);
}

.ha-flow--lifetime {
  margin-top: 26px;
}

.ha-flow__card--lifetime {
  max-width: 380px;
  aspect-ratio: 1 / 1;
}

.ha-flow__title {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.ha-flow__title.is-off-grid-label {
  padding-bottom: 3px;
  background-image: linear-gradient(90deg, #6ff3b2 0%, #1a6f3e 50%, #6ff3b2 100%);
  background-size: 320% 3px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  animation: off-grid-underline 1.6s ease-in-out infinite alternate;
}

@keyframes off-grid-underline {
  0% { background-position: 0 100%; }
  100% { background-position: 100% 100%; }
}

.ha-flow__title--lower {
  top: 42px;
}

.ha-flow__live {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: color-mix(in srgb, #b8ffcf 75%, Canvas 25%);
  color: #0b3f1f;
}

.ha-flow__live--top-left {
  left: 15px;
  top: 10px;
  right: auto;
  bottom: auto;
}

.home-solar-intro {
  max-width: none;
}

.sundog-inline-logo {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-left: 0;
}

.sundog-inline-logo-link {
  display: inline-flex;
  margin-left: 6px;
}

.ha-flow__live--neutral {
  background: color-mix(in srgb, Canvas 92%, transparent);
  color: color-mix(in srgb, CanvasText 75%, transparent);
}

.ha-flow__card.is-off-grid {
  border-color: color-mix(in srgb, #3dff9f 65%, transparent);
  box-shadow:
    0 18px 36px color-mix(in srgb, CanvasText 10%, transparent),
    0 0 26px color-mix(in srgb, #3dff9f 35%, transparent);
  animation: off-grid-pulse 2.8s ease-in-out infinite;
}

@keyframes off-grid-pulse {
  0% {
    box-shadow:
      0 18px 36px color-mix(in srgb, CanvasText 10%, transparent),
      0 0 18px color-mix(in srgb, #3dff9f 25%, transparent);
  }
  50% {
    box-shadow:
      0 18px 36px color-mix(in srgb, CanvasText 10%, transparent),
      0 0 34px color-mix(in srgb, #3dff9f 45%, transparent);
  }
  100% {
    box-shadow:
      0 18px 36px color-mix(in srgb, CanvasText 10%, transparent),
      0 0 18px color-mix(in srgb, #3dff9f 25%, transparent);
  }
}

.ha-flow__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ha-line {
  fill: none;
  stroke-width: 0.68;
  stroke-linecap: round;
  opacity: 1;
}

:root {
  --ha-solar-color: #ff9f1c;
  --ha-solar-grid-color: #d56bff;
  --ha-solar-battery-color: #f06292;
  --ha-battery-color: #20c997;
  --ha-grid-color: #4f8cff;
  --ha-neutral-color: #7a8794;
}

.ha-line--solar-home {
  stroke: #ff9f1c;
}

.ha-line--solar-battery {
  stroke: var(--ha-solar-battery-color);
}

.ha-line--solar-grid {
  stroke: var(--ha-solar-grid-color);
}

.ha-line--battery-home,
.ha-line--battery-grid {
  stroke: #20c997;
}

.ha-line--grid-home {
  stroke: #4f8cff;
}

.ha-line--solar-battery {
  stroke: var(--ha-solar-battery-color);
}

.ha-line--battery-grid {
  stroke: #4f8cff;
}

.ha-line.is-idle {
  opacity: 0.2;
}

.ha-dot {
  opacity: 1;
  transform-box: fill-box;
  transform-origin: center;
}

.ha-dot--solar-home {
  fill: #ff9f1c;
}

.ha-dot--solar-grid {
  fill: var(--ha-solar-grid-color);
}

.ha-dot--battery-home,
.ha-dot--battery-grid {
  fill: #20c997;
}

.ha-dot--grid-home {
  fill: #4f8cff;
}

.ha-dot--solar-battery {
  fill: var(--ha-solar-battery-color);
}

.ha-dot.is-idle {
  opacity: 0;
}

.ha-circle {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, CanvasText 18%, transparent);
  background: color-mix(in srgb, Canvas 100%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  font-size: 12px;
  line-height: 1;
  padding-bottom: 6px;
}

.ha-circle__label {
  font-size: 38px;
  line-height: 1;
  opacity: 0.85;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ha-circle__label--house {
  font-size: 47px;
  display: inline-flex;
  transform: scaleX(1.15);
}

.ha-icon {
  width: 35px;
  height: 35px;
  display: block;
}

.ha-icon--battery {
  transform: rotate(90deg);
  transform-origin: 50% 50%;
  width: 64px;
  height: 28px;
}

.ha-circle__value {
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
}

.ha-flow__card--lifetime .ha-circle__value--sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  position: relative;
  top: -2px;
}

#ha-life-grid-import {
  color: var(--ha-grid-color);
  top: -8px;
}

#ha-life-grid-export {
  color: var(--ha-solar-grid-color);
  top: -8px;
}

#ha-life-battery-charge {
  color: var(--ha-solar-battery-color);
  top: -8px;
}

#ha-life-battery-discharge {
  color: var(--ha-battery-color);
  top: -8px;
}

#ha-battery[data-state="charging"] {
  color: var(--ha-solar-battery-color);
}

#ha-battery[data-state="discharging"] {
  color: var(--ha-battery-color);
}

#ha-battery[data-state="idle"] {
  color: #000;
}

#ha-grid[data-state="import"] {
  color: var(--ha-grid-color);
}

#ha-grid[data-state="export"] {
  color: var(--ha-solar-grid-color);
}

#ha-grid[data-state="idle"] {
  color: #000;
}

.ha-flow__card--lifetime .ha-circle__value {
  font-size: 13px;
}

.ha-flow__card--lifetime .ha-circle__label {
  margin-bottom: 4px;
}

.ha-flow__card--lifetime .ha-circle--solar .ha-circle__label {
  margin-bottom: 6px;
}

.ha-circle--battery-lifetime {
  gap: 2px;
  border: none;
}

.ha-circle--battery-lifetime::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--battery-life-ring, conic-gradient(var(--ha-neutral-color) 0% 100%));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
}

.ha-circle--battery-lifetime > * {
  position: relative;
  z-index: 1;
}

.ha-circle--grid-lifetime {
  gap: 2px;
  border: none;
}

.ha-circle--grid-lifetime::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--grid-life-ring, conic-gradient(var(--ha-neutral-color) 0% 100%));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
}

.ha-circle--grid-lifetime > * {
  position: relative;
  z-index: 1;
}

.ha-circle--solar {
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: color-mix(in srgb, #ff9f1c 60%, transparent);
}

.ha-circle--grid {
  top: 50%;
  left: 18%;
  transform: translate(-50%, -50%);
  border-color: color-mix(in srgb, #4f8cff 60%, transparent);
}

.ha-circle--home {
  top: 50%;
  left: 82%;
  transform: translate(-50%, -50%);
  border: none;
}

.ha-circle--home::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--home-flow-ring, conic-gradient(var(--ha-neutral-color) 0% 100%));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
}

.ha-circle--home > * {
  position: relative;
  z-index: 1;
}

.ha-circle--home .ha-circle__label {
  margin-top: -12px;
}

.ha-circle--home .ha-circle__value {
  margin-top: 0;
}

.ha-circle--battery {
  top: 82%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: color-mix(in srgb, #20c997 60%, transparent);
}

#ha-flow-card .ha-circle--battery[data-state="charging"] {
  border-color: color-mix(in srgb, var(--ha-solar-battery-color) 60%, transparent);
}

#ha-flow-card .ha-circle--battery[data-state="discharging"] {
  border-color: color-mix(in srgb, var(--ha-battery-color) 60%, transparent);
}

@media (max-width: 640px) {
  .ha-flow__card {
    max-width: 320px;
  }

  .ha-circle {
    width: 82px;
    height: 82px;
  }
}

@media (max-width: 900px) {
  .energy-hero {
    grid-template-columns: 1fr;
  }

  .energy-flow {
    min-height: 320px;
  }

  .energy-node {
    min-width: 120px;
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .energy-flow {
    min-height: 300px;
  }

  .energy-node--solar,
  .energy-node--battery {
    left: 18%;
  }

  .energy-node--grid {
    left: 82%;
  }

  .energy-node--house {
    left: 68%;
  }

  .energy-flow__label {
    font-size: 11px;
  }
}

/* Quasar Lox game page */
body.quasar-lox-page {
  background: #02050f;
  color: #e6f0ff;
  overflow: hidden;
}

body.quasar-lox-page .header,
body.quasar-lox-page .footer {
  display: none;
}

body.quasar-lox-page .main {
  max-width: none;
  padding: 0;
  margin: 0;
  height: 100vh;
}

body.quasar-lox-page::before {
  display: none;
}

.qlx-main {
  min-height: 100vh;
}

.qlx-app {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 30% 10%, rgba(90, 130, 255, 0.25), transparent 45%),
    linear-gradient(180deg, #050816 0%, #02050f 60%, #01030a 100%);
}

#qlx-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.qlx-ui {
  position: absolute;
  inset: 0;
  color: #e6f0ff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  pointer-events: none;
}

.qlx-hidden {
  display: none !important;
}

.qlx-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 20px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qlx-hud-left,
.qlx-hud-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qlx-hud-center {
  display: grid;
  place-items: center;
  flex: 1;
}

.qlx-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(230, 240, 255, 0.8);
}

.qlx-bar {
  width: 160px;
  height: 8px;
  border-radius: 999px;
  background: rgba(6, 12, 26, 0.8);
  border: 1px solid rgba(120, 160, 255, 0.25);
  overflow: hidden;
}

.qlx-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4fd2ff, #9be7ff);
  transition: width 0.15s ease;
}

.qlx-aim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(120, 180, 255, 0.18));
}

.qlx-aim::before,
.qlx-aim::after {
  content: "";
  position: absolute;
}

.qlx-aim::before {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(230, 240, 255, 0.1) 18%,
    rgba(230, 240, 255, 0.32) 50%,
    rgba(230, 240, 255, 0.1) 82%,
    transparent 100%
  );
}

.qlx-aim::after {
  height: 2px;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(230, 240, 255, 0.12) 18%,
    rgba(230, 240, 255, 0.32) 50%,
    rgba(230, 240, 255, 0.12) 82%,
    transparent 100%
  );
}

.qlx-reticle {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  position: relative;
}

.qlx-reticle::before,
.qlx-reticle::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
}

.qlx-reticle::before {
  width: 2px;
  height: 14px;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
}

.qlx-reticle::after {
  height: 2px;
  width: 14px;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
}

.qlx-hit {
  margin-top: 16px;
  font-weight: 700;
  color: #ffd479;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 12px rgba(255, 212, 121, 0.6);
}

.qlx-hit.show {
  opacity: 1;
}

.qlx-boss-bar {
  position: absolute;
  left: 50%;
  top: 68px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  pointer-events: none;
}

.qlx-boss-bar .qlx-bar {
  width: 260px;
}

.qlx-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.qlx-panel {
  width: min(480px, 92vw);
  background: rgba(6, 12, 26, 0.85);
  border: 1px solid rgba(120, 160, 255, 0.2);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qlx-panel h1,
.qlx-panel h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.qlx-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(155, 190, 255, 0.7);
  font-size: 12px;
}

.qlx-muted {
  color: rgba(230, 240, 255, 0.65);
  font-size: 14px;
}

.qlx-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.qlx-toggle-group {
  display: flex;
  gap: 8px;
}

.qlx-toggle-group button {
  flex: 1;
  background: rgba(22, 34, 68, 0.8);
  border: 1px solid rgba(120, 160, 255, 0.2);
  color: rgba(230, 240, 255, 0.8);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.qlx-toggle-group button.is-active {
  background: linear-gradient(135deg, #4fd2ff, #436bff);
  color: #051021;
}

.qlx-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.qlx-checkbox input {
  accent-color: #4fd2ff;
}

.qlx-actions {
  display: flex;
  gap: 12px;
}

.qlx-primary,
.qlx-secondary {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 12px 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.qlx-primary {
  background: linear-gradient(135deg, #4fd2ff, #436bff);
  color: #04101f;
}

.qlx-secondary {
  background: rgba(22, 34, 68, 0.85);
  color: #dbe7ff;
  border: 1px solid rgba(120, 160, 255, 0.2);
}

.qlx-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 15px;
}

.qlx-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(12, 20, 42, 0.85);
  color: #ffd479;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.qlx-toast.show {
  opacity: 1;
}

.qlx-debug {
  position: absolute;
  right: 16px;
  bottom: 18px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(230, 240, 255, 0.7);
  background: rgba(4, 8, 18, 0.6);
  padding: 8px 12px;
  border-radius: 10px;
  white-space: pre-line;
}

@media (max-width: 720px) {
  .qlx-hud {
    flex-direction: column;
    align-items: flex-start;
  }

  .qlx-hud-right {
    align-items: flex-start;
  }

  .qlx-actions {
    flex-direction: column;
  }

  .qlx-boss-bar {
    top: 110px;
  }
}
