/*
Theme Name: Osiris Portfolio
Theme URI: https://osirisnetworking.com/
Author: Matt Anderson
Description: Lightweight portfolio and resume theme for Osiris Networking. Dark-first, photo-forward.
Version: 2.0.0
License: GPL-3.0-or-later
Text Domain: osiris-portfolio
*/

/* ---------------------------------------------------------------------------
   Tokens — dark is the default theme, light overrides via [data-theme="light"]
--------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --surface: #111827;
  --surface-2: #16203380;
  --ink: #e8eef8;
  --muted: #9fabc2;
  --line: rgba(148, 170, 205, 0.16);
  --line-strong: rgba(148, 170, 205, 0.3);
  --blue: #6db1e8;
  --accent: #8fd0ff;
  --green: #5fd0a0;
  --btn-bg: #e8eef8;
  --btn-ink: #0a0f1c;
  --btn-hover: #ffffff;
  --nav-bg: rgba(9, 14, 26, 0.55);
  --nav-line: rgba(148, 170, 205, 0.12);
  --scrim: 10, 15, 28;
  --shadow: 0 18px 45px rgba(2, 6, 16, 0.5);
  --card-radius: 14px;
  --nav-h: 72px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --ink: #162033;
  --muted: #5c667a;
  --line: #dbe0ea;
  --line-strong: #c4cdde;
  --blue: #2368a2;
  --accent: #1d5f9a;
  --green: #24765a;
  --btn-bg: #162033;
  --btn-ink: #ffffff;
  --btn-hover: #27344e;
  --nav-bg: rgba(255, 255, 255, 0.62);
  --nav-line: rgba(22, 32, 51, 0.08);
  --shadow: 0 18px 45px rgba(22, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

/* ---------------------------------------------------------------------------
   Glass navigation
--------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--nav-line);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: calc(100% - 48px);
  min-height: var(--nav-h);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand span {
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: block;
}

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

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

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

/* ---------------------------------------------------------------------------
   Full-viewport photo heroes
--------------------------------------------------------------------------- */
.hero-full {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  color: #fff;
  background-image:
    linear-gradient(180deg, rgba(var(--scrim), 0.42) 0%, rgba(var(--scrim), 0.05) 34%, rgba(var(--scrim), 0.55) 78%, rgba(var(--scrim), 0.92) 100%),
    var(--hero-image);
  background-position: center;
  background-size: cover;
}

.hero-full.hero-short {
  min-height: 62vh;
  min-height: 62svh;
}

.hero-full-inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 0 clamp(56px, 10vh, 110px);
}

.hero-full .eyebrow {
  color: #87dfb5;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.hero-full h1 {
  max-width: 780px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero-full .lead {
  max-width: 640px;
  color: #dbe4f0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}

.hero-full .hero-actions {
  margin-top: 30px;
}

.hero-credit {
  position: absolute;
  right: 20px;
  bottom: 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* Legacy page hero (kept for the SARkart project page) */
.page-hero {
  color: #fff;
  min-height: clamp(380px, 34vw, 520px);
  background-image: linear-gradient(90deg, rgba(var(--scrim), 0.82), rgba(var(--scrim), 0.5) 50%, rgba(var(--scrim), 0.16)), var(--page-hero-image);
  background-position: center 58%;
  background-size: cover;
}

.page-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  gap: 28px;
  align-items: center;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 0 72px;
}

.page-hero .lead {
  color: #d7deeb;
}

.page-hero .eyebrow {
  color: #87dfb5;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------------------
   Typography
--------------------------------------------------------------------------- */
.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.6rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
}

.lead {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.6vw, 1.22rem);
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  color: var(--btn-ink);
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}

.hero-full .button.secondary,
.page-hero .button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.08);
}

.hero-full .button.secondary:hover,
.page-hero .button.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.hero-full .button,
.page-hero .button {
  background: #e8eef8;
  color: #0a0f1c;
}

.hero-full .button:hover,
.page-hero .button:hover {
  background: #ffffff;
  color: #0a0f1c;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ---------------------------------------------------------------------------
   Sections and cards
--------------------------------------------------------------------------- */
.section {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 104px) 0;
}

.section + .section {
  padding-top: 0;
}

/* Tool pages get a wider stage for tables and visualizations; hero text
   stays on the standard 1240px grid so it reads anchored, not lost. */
.tool-page .section {
  width: min(1600px, calc(100% - 48px));
}

/* Bleed pages (the actual tools: calculator, sarkart): the hero image
   bleeds behind the whole page, and content panels float over it with the
   nav bar's glass treatment. Catalog/browse pages keep the front-page
   pattern — image contained to the hero, solid background below. */
.bleed-page .page-hero {
  background-image: none;
  min-height: 0;
}

.bleed-page .page-hero-inner {
  padding-bottom: 14px;
}

.bleed-page .page-hero + .section {
  padding-top: 28px;
}

.bleed-page .page-hero::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(var(--scrim), 0.35), rgba(var(--scrim), 0.6)), var(--page-hero-image);
  background-position: center;
  background-size: cover;
}

.bleed-page main > section,
.bleed-page .page-hero-inner,
.bleed-page .site-footer {
  position: relative;
  z-index: 1;
}

.bleed-page .calc-panel,
.bleed-page .card {
  background: var(--nav-bg);
  border-color: var(--nav-line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.bleed-page .site-footer {
  background: var(--nav-bg);
  border-top-color: var(--nav-line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

/* Section text outside panels sits directly on the darkened image —
   keep it light in both themes. */
.bleed-page .section-header {
  color: #dbe4f0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.bleed-page .section-header h2 {
  color: #fff;
}

.bleed-page .section-header p {
  color: #dbe4f0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.section-header p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

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

.card {
  min-height: 180px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.card p {
  color: var(--muted);
}

.card a {
  font-weight: 700;
}

.tool-grid .card {
  min-height: 170px;
}

/* Featured tool */
.tool-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: stretch;
}

.tool-copy,
.tool-media {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.tool-copy {
  padding: 30px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
}

.tool-copy ul,
.resume-list,
.contact-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.tool-copy li,
.resume-list li,
.contact-list li {
  position: relative;
  padding-left: 22px;
  margin: 10px 0;
  color: var(--muted);
}

.tool-copy li::before,
.resume-list li::before,
.contact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.tool-media {
  display: flex;
  align-items: center;
  min-height: 340px;
  padding: 14px;
  overflow: hidden;
}

.tool-media img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Resume bands and boxes */
.resume-band {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.resume-band .section {
  padding: clamp(56px, 8vw, 88px) 0;
}

.resume-band .section-header p,
.resume-band .resume-list li {
  color: var(--muted);
}

.resume-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.resume-box {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-2);
}

.resume-box.light {
  border-color: var(--line);
  background: var(--surface);
}

.tools-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.tools-cta p {
  max-width: 680px;
  color: var(--muted);
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  align-items: start;
}

.contact-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
}

/* ---------------------------------------------------------------------------
   Photo teaser (homepage) and Photos page grid
--------------------------------------------------------------------------- */
.photo-teaser {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.photo-teaser a {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.photo-teaser img,
.photo-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.photo-teaser a:hover img {
  transform: scale(1.04);
}

.photo-grid {
  columns: 3;
  column-gap: 16px;
}

.photo-grid a {
  display: block;
  position: relative;
  margin-bottom: 16px;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--line);
  break-inside: avoid;
}

.photo-grid img {
  height: auto;
}

.photo-grid a:hover img {
  transform: scale(1.03);
}

.photo-grid figcaption,
.photo-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 30px 16px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.photo-grid a:hover figcaption,
.photo-teaser a:hover .photo-caption {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 16, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 14px;
  color: #cdd8e8;
  font-size: 0.92rem;
}

.lightbox button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------------------------------------------------------------------------
   Calculator (GOP size tool)
--------------------------------------------------------------------------- */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr);
  gap: 22px;
  align-items: start;
}

.calc-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.calc-results {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.calc-field {
  margin-top: 18px;
}

.calc-field:first-of-type {
  margin-top: 14px;
}

.calc-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.calc-field input,
.calc-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.calc-field input:focus,
.calc-field select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.calc-error {
  margin: 6px 0 0;
  color: #e07a7a;
  font-size: 0.86rem;
  min-height: 0;
}

.calc-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.calc-warning {
  margin: 10px 0 0;
  color: #d9a13c;
  font-size: 0.92rem;
}

.calc-warning:empty,
.calc-error:empty,
.calc-note:empty {
  display: none;
}

.calc-base {
  margin: 10px 0 0;
  color: var(--muted);
}

.calc-base strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.calc-chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.calc-chip {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.calc-chip:hover {
  color: var(--ink);
  background: var(--surface-2);
}

/* Two-rulers alignment visualization */
.gop-viz svg {
  display: block;
  width: 100%;
  max-width: 780px;
  height: auto;
  margin: 6px auto 0;
}

.viz-caption {
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.viz-caption strong {
  color: var(--ink);
}

/* Middle-school-style worked fractions */
.viz-math {
  margin: 14px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.viz-math-step {
  margin: 6px 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.viz-math-label {
  display: inline-block;
  min-width: 92px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viz-math-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
}

.viz-math-conclusion {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
  font-weight: 700;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  margin: 0 3px;
  vertical-align: middle;
  text-align: center;
  line-height: 1.1;
  font-size: 0.88em;
  font-variant-numeric: tabular-nums;
}

.frac-top {
  padding: 0 5px 1px;
  border-bottom: 1.5px solid currentColor;
}

.frac-bot {
  padding: 1px 5px 0;
}

.frac-int {
  font-variant-numeric: tabular-nums;
}

.viz-summary {
  margin: 10px 0 0;
  color: var(--muted);
}

.viz-summary strong {
  color: var(--ink);
}

.viz-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.viz-help summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}

.viz-help p {
  margin: 8px 0 0;
}

/* Step-by-step derivation */
.math-steps {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.math-intro {
  color: var(--muted);
}

.math-step {
  padding: 10px 16px;
  border-left: 3px solid var(--line-strong);
}

.math-step p {
  margin: 6px 0 0;
  color: var(--muted);
}

.math-step-title {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.math-work {
  color: var(--ink) !important;
  font-weight: 700;
  font-size: 1.02rem;
}

.math-shortcut {
  border-left-color: var(--blue);
}

/* Learn toggle */
.calc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calc-panel-head h3 {
  margin: 0;
}

.learn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.learn-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.learn-slider {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s;
}

.learn-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.learn-toggle input:checked + .learn-slider {
  background: var(--blue);
}

.learn-toggle input:checked + .learn-slider::after {
  transform: translateX(16px);
}

.learn-toggle input:focus-visible + .learn-slider {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Answer strip — the compact result beside the inputs */
.calc-answer {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.calc-answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: baseline;
}

.calc-answer-label {
  min-width: 170px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.calc-answer-value {
  color: var(--ink);
  font-size: 1.05rem;
}

.calc-answer-value strong {
  font-size: 1.25rem;
}

/* Analogy switch */
.analogy-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
}

.analogy-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.analogy-btn {
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.analogy-btn.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.analogy-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Category blocks (tools + articles catalogs) */
.cat-block {
  margin-top: 52px;
}

.cat-block:first-of-type {
  margin-top: 8px;
}

.cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cat-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.cat-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-soon {
  border-style: dashed;
}

.card-soon h3,
.card-soon p {
  color: var(--muted);
}

.article-date {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Single article body */
.article-body {
  max-width: 780px;
}

.article-body h2 {
  margin: 40px 0 12px;
}

.article-body h3 {
  margin: 28px 0 10px;
}

.article-body p,
.article-body li {
  line-height: 1.75;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.article-body pre {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  overflow-x: auto;
}

.article-body code {
  font-size: 0.92em;
}

.article-body blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--blue);
  color: var(--muted);
}

.article-back {
  margin-top: 40px;
}

/* Submit button (Learn mode) */
.calc-apply {
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: not-allowed;
}

.calc-apply.is-dirty {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  cursor: pointer;
  animation: apply-pulse 1.6s ease-out infinite;
}

@keyframes apply-pulse {
  0% { box-shadow: 0 0 0 0 rgba(109, 177, 232, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(109, 177, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(109, 177, 232, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .calc-apply.is-dirty {
    animation: none;
    box-shadow: 0 0 0 3px rgba(109, 177, 232, 0.35);
  }
}

/* Scene playback controls */
.viz-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 2px;
}

.viz-play {
  padding: 6px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.viz-play:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.viz-time {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Scene: shared animation states */
.gop-viz svg .gop-playhead {
  opacity: 0;
}

.gop-viz svg .gop-playhead line {
  stroke: var(--accent);
  stroke-width: 2;
}

.gop-viz svg .gop-playhead path {
  fill: var(--accent);
}

.gop-viz svg.gop-animating .gop-playhead {
  opacity: 1;
}

.gop-viz svg.gop-animating [data-x] {
  opacity: 0.14;
  transition: opacity 0.15s ease-out;
}

.gop-viz svg.gop-animating [data-x].lit {
  opacity: 1;
}

.gop-viz svg.gop-payoff .gop-align,
.gop-viz svg.gop-payoff .gop-align-dot,
.gop-viz svg.gop-payoff .gop-align-label,
.gop-viz svg.gop-payoff .gop-bus,
.gop-viz svg.gop-payoff .gop-cut {
  animation: gold-flash 1.2s ease-out;
}

@keyframes gold-flash {
  0% { filter: brightness(2.4) saturate(1.6); }
  100% { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gop-viz svg.gop-payoff .gop-align,
  .gop-viz svg.gop-payoff .gop-align-dot,
  .gop-viz svg.gop-payoff .gop-align-label,
  .gop-viz svg.gop-payoff .gop-bus,
  .gop-viz svg.gop-payoff .gop-cut {
    animation: none;
  }
}

/* Scene: standard mode extras */
.gop-viz .gop-mini-label {
  fill: var(--blue);
  font-size: 11px;
  font-weight: 600;
}

.gop-viz .gop-mini-a {
  fill: var(--green);
}

.gop-viz .gop-cut {
  fill: var(--muted);
  font-size: 16px;
}

/* Scene: ruler mode */
.gop-viz .gop-ruler-body {
  fill: var(--surface-2);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.gop-viz .gop-ruler-edge {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.gop-viz .gop-etch {
  stroke-width: 1.6;
}

.gop-viz .gop-ruler-num {
  fill: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.gop-viz .gop-route {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gop-viz .gop-route-v {
  fill: var(--blue);
}

.gop-viz .gop-route-a {
  fill: var(--green);
}

/* Scene: bus mode */
.gop-viz .gop-terminal {
  fill: var(--surface-2);
  stroke: var(--line-strong);
}

.gop-viz .gop-lane {
  fill: var(--surface-2);
  stroke: var(--line);
}

.gop-viz .gop-lane-dash {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 8 8;
}

.gop-viz .gop-stop-v {
  fill: var(--blue);
}

.gop-viz .gop-stop-a {
  fill: var(--green);
}

.gop-viz .gop-bus-body {
  fill: #d9a13c;
  stroke: rgba(0, 0, 0, 0.35);
}

.gop-viz .gop-bus-win {
  fill: var(--bg);
}

.gop-viz .gop-bus-wheel {
  fill: var(--ink);
}

.gop-viz .gop-bus-v .gop-bus-body {
  fill: var(--blue);
}

.gop-viz .gop-bus-a .gop-bus-body {
  fill: var(--green);
}

/* Recalculation feedback pulse */
@keyframes calc-flash {
  0% { box-shadow: 0 0 0 2px var(--blue); }
  100% { box-shadow: 0 0 0 2px transparent; }
}

.calc-panel.calc-flash {
  animation: calc-flash 0.7s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .calc-panel.calc-flash {
    animation: none;
  }
}

.viz-legend-v {
  color: var(--blue);
  font-weight: 700;
}

.viz-legend-a {
  color: var(--green);
  font-weight: 700;
}

.viz-legend-x {
  color: #d9a13c;
  font-weight: 700;
}

.gop-viz .gop-ruler {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.gop-viz .gop-tick-v {
  stroke: var(--blue);
  stroke-width: 2;
}

.gop-viz .gop-tick-a {
  stroke: var(--green);
  stroke-width: 2;
}

.gop-viz .gop-align {
  stroke: #d9a13c;
  stroke-width: 3;
  stroke-linecap: round;
}

.gop-viz .gop-align-dot {
  fill: #d9a13c;
}

.gop-viz .gop-align-label {
  fill: #d9a13c;
  font-size: 27px;
  font-weight: 600;
}

.gop-viz .gop-axis-label {
  fill: var(--muted);
  font-size: 25px;
}

.gop-viz .gop-break {
  stroke: var(--muted);
  stroke-width: 2.5;
  fill: none;
}

.calc-suggestions {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.calc-suggestions li {
  position: relative;
  padding-left: 22px;
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.55;
}

.calc-suggestions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.calc-suggestions strong {
  color: var(--ink);
}

.calc-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.calc-table-scroll {
  max-height: 420px;
  overflow-y: auto;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.calc-table th,
.calc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.calc-table td.calc-gopopts {
  white-space: normal;
  min-width: 220px;
  color: var(--muted);
}

.calc-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calc-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.calc-badge-exact {
  color: var(--green);
  border-color: var(--green);
}

@media (max-width: 960px) {
  .calc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer {
  padding: 38px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-social a {
  display: inline-flex;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-social a:hover {
  color: var(--blue);
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .photo-grid {
    columns: 2;
  }

  .photo-teaser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .nav {
    gap: 12px;
  }

  .brand span {
    display: none;
  }

  .nav-links {
    overflow-x: auto;
    padding-bottom: 2px;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .hero-full-inner {
    padding-bottom: 64px;
  }

  .hero-full h1 {
    font-size: 2.35rem;
  }

  .page-hero-inner,
  .tool-feature,
  .resume-columns,
  .tools-cta,
  .contact {
    grid-template-columns: 1fr;
  }

  .tools-cta {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-media {
    min-height: 0;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .photo-grid {
    columns: 1;
  }

  .photo-teaser {
    grid-template-columns: 1fr;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .lightbox-prev {
    left: 24px;
  }

  .lightbox-next {
    right: 24px;
  }
}

/* ---------------------------------------------------------------------------
   Solar Power Calculator
--------------------------------------------------------------------------- */
.solar-layout {
  grid-template-columns: minmax(320px, 1.15fr) minmax(0, 1fr);
}

.solar-subhead {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

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

.solar-rows {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.solar-row {
  display: grid;
  gap: 6px;
  align-items: center;
}

.solar-load-grid {
  grid-template-columns: minmax(0, 1fr) 60px 60px 60px 28px;
}

.solar-panel-grid {
  grid-template-columns: minmax(0, 1fr) 58px 58px 58px 46px 28px;
}

.solar-row-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.solar-row-data input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.solar-row-data input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.solar-del {
  min-height: 38px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.solar-del:hover {
  color: #e07a7a;
  background: var(--surface-2);
}

.solar-add {
  margin-top: 10px;
}

.solar-presets {
  margin-top: 0;
}

.solar-nrel-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.solar-nrel-row input {
  max-width: 140px;
}

.solar-nrel-row .calc-chip {
  min-height: 44px;
  flex-shrink: 0;
}

.solar-nrel-pick {
  margin-top: 10px;
}

.solar-nrel-pick select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.solar-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
}

.solar-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--blue);
}

td.solar-rowlabel {
  color: var(--muted);
  font-weight: 700;
  white-space: normal;
}

.solar-alerts {
  margin-top: 16px;
}

@media (max-width: 620px) {
  .solar-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .solar-row-head {
    display: none;
  }

  .solar-load-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 28px;
  }

  .solar-panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 28px;
  }

  .solar-row-data input:first-child {
    grid-column: 1 / -1;
  }
}
