/* Editorial layout, theme tokens, and the portfolio hero. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #141712;
  --bg-secondary: #1b1e17;
  --bg-card: #20241c;
  --bg-card-hover: #282d22;
  --bg-nav: rgba(20, 23, 18, 0.94);
  --text-primary: #f4efe2;
  --text-secondary: #c4c6b8;
  --editorial-accent: #b6cc9f;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f4efe2;
  --bg-secondary: #ebe5d6;
  --bg-card: #fffaf0;
  --bg-card-hover: #f8f2e4;
  --bg-nav: rgba(244, 239, 226, 0.94);
  --text-primary: #20231b;
  --text-secondary: #4e5346;
  --editorial-accent: #405c36;
}

.portfolio-journey {
  position: relative;
  z-index: 1;
}

.portfolio-journey .hero {
  min-height: auto;
  display: block;
  padding: clamp(7rem, 13vw, 10rem) clamp(1.25rem, 6vw, 6rem) clamp(3rem, 7vw, 6rem);
  background: var(--bg-primary);
  text-align: left;
}

.portfolio-journey .hero::before { display: none; }

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 1260px;
  margin-inline: auto;
}

.portfolio-journey .hero-name,
.portfolio-journey .section-title {
  font-family: Georgia, Cambria, serif;
  font-weight: 400;
  letter-spacing: -0.055em;
}

.portfolio-journey .hero-greeting {
  color: var(--editorial-accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.portfolio-journey .hero-name {
  margin: 0.5rem 0 1.2rem;
  color: var(--text-primary);
  font-size: clamp(3.2rem, 6.5vw, 7.5rem);
  line-height: 0.93;
  text-shadow: none;
}

.portfolio-journey .hero-subtitle {
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.portfolio-journey .hero-cta-group {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: auto;
  gap: 0.6rem;
  margin: 1.6rem 0 1.2rem;
}

.portfolio-journey .hero-cta-group .btn {
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding-inline: 1rem;
  gap: 0.45rem;
}

.portfolio-journey .hero-cta-group .btn-primary {
  background: var(--editorial-accent) !important;
  border-color: var(--editorial-accent) !important;
  color: var(--bg-primary) !important;
  box-shadow: none !important;
}

.hero-availability {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.portfolio-journey :is(.reveal, .reveal-left, .reveal-right, .reveal-scale) {
  opacity: 1;
  transform: none;
}

.portfolio-journey .section { scroll-margin-top: 100px; }

#projects {
  border-top: 1px solid var(--border-color-hover);
}

.projects-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1.5rem;
}

.projects-filter-bar .filter-btn {
  min-height: 44px;
  border-color: var(--border-color-hover);
  transition: background-color 0.2s, color 0.2s;
}

.projects-filter-bar .filter-btn[aria-pressed="true"] {
  background: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: none;
}

.portfolio-journey .projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0 0 2rem;
  overflow: visible;
  cursor: auto;
}

.portfolio-journey .projects-grid .project-card {
  max-width: none;
  border-radius: 0.65rem;
}

.portfolio-journey .project-card.featured {
  grid-column: auto;
  flex-direction: column;
}

.portfolio-journey .project-card.featured .project-card-image,
.portfolio-journey .project-card.featured .project-card-body {
  width: 100%;
}

.portfolio-journey .project-card.featured .project-card-image {
  min-height: 0;
  aspect-ratio: 16 / 10;
}

.portfolio-journey .project-card.featured .project-card-body {
  padding: clamp(1rem, 2.5vw, 2rem);
}

.portfolio-journey .project-card-image img {
  object-fit: contain;
  background: #10151b;
}

.portfolio-journey .project-card-desc {
  display: block;
  overflow: visible;
}

.project-card-category { color: var(--editorial-accent); }

.contact-form label {
  color: var(--text-primary);
  font-size: 0.85rem;
}

.contact-form textarea { resize: vertical; }

.skip-link {
  position: fixed;
  z-index: 10001;
  left: 12px;
  top: 12px;
  padding: 10px 14px;
  color: var(--bg-primary);
  background: var(--text-primary);
  border-radius: 6px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Keep the theme control in the navigation's layout, including tablet widths. */
.nav-wrapper { width: 100%; left: 0; }
.navbar { overflow: visible; }
.theme-toggle {
  position: relative;
  inset: auto;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

@media (max-width: 820px) {
  .nav-wrapper { left: 16px; right: 16px; width: auto; max-width: none; }
  .navbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
    max-width: 100%;
    padding: 6px;
    overflow: visible;
  }
  .nav-links { display: none; }
  .nav-divider { display: none; }
  .nav-menu-toggle { display: inline-flex; }
  .navbar.menu-open { width: min(100%, 370px); border-radius: 20px; }
  .navbar.menu-open .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 3;
    width: 100%;
    gap: 4px;
  }
  .navbar.menu-open .nav-link { padding: 12px; text-align: center; }
  .theme-toggle { position: relative; inset: auto; width: 36px; height: 36px; }
}


@media (max-width: 760px) {
  .hero-layout { grid-template-columns: 1fr; }
  .portfolio-journey .projects-grid { grid-template-columns: 1fr; }
}

/* The point cloud blends into the page and stays outside the reading column. */
.hero-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1.16;
  color: var(--editorial-accent);
}

.hero-art-fallback {
  font: italic 400 clamp(7rem, 24vw, 23rem)/1 Georgia, Cambria, serif;
  letter-spacing: -0.12em;
  opacity: 0.42;
  transform: translateX(-0.06em) rotate(-9deg);
}

.hero-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-art[data-ready] .hero-art-fallback { visibility: hidden; }

@media (max-width: 760px) {
  .hero-layout { gap: 0.25rem; }
  .hero-art { aspect-ratio: 1.5; }
}

@media print {
  .hero-art { display: none; }
}

.about-bento .bento-slider { grid-row: auto; }

.contact-qr {
  grid-column: 1 / -1;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.contact-qr img {
  display: block;
  padding: 0.4rem;
  background: #fff;
  object-fit: contain;
}

#projectModal a[hidden] { display: none !important; }

.contact-disclosure {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.case-page-link {
  min-height: 44px;
  padding-inline: 0.9rem;
}

.case-page {
  width: min(100% - 2.5rem, 760px);
  margin: 0 auto;
  padding-block: clamp(2rem, 7vw, 5rem);
}

.case-page header { padding-block: 2.5rem 1.5rem; }

.case-page h1,
.case-page h2 {
  font-family: Georgia, Cambria, serif;
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

.case-page h1 { font-size: clamp(2.65rem, 8vw, 5.2rem); }
.case-page h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
.case-page section { margin-top: 2.25rem; }
.case-page p, .case-page li { margin-top: 0.7rem; }
.case-page ul { padding-inline-start: 1.25rem; }

.case-page a {
  color: var(--editorial-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.case-example {
  padding: clamp(1rem, 4vw, 1.8rem);
  border: 1px solid var(--border-color-hover);
  border-radius: 0.65rem;
  background: var(--bg-card);
}

.case-example dt { margin-top: 0.9rem; font-weight: 600; }
.case-example dd { margin: 0.15rem 0 0; color: var(--text-secondary); }


/* Optional personal notes stay out of the main reading path. */
.portfolio-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.portfolio-note summary {
  width: fit-content;
  min-height: 44px;
  padding-block: 0.55rem;
  color: var(--editorial-accent);
  cursor: pointer;
}

.portfolio-note summary:focus-visible {
  outline: 2px solid var(--editorial-accent);
  outline-offset: 3px;
}

.portfolio-note p {
  max-width: 43ch;
  margin: 0 0 0.5rem;
}

.footer .portfolio-note {
  width: fit-content;
  margin: 0.75rem auto 0;
}

.footer .portfolio-note summary { margin-inline: auto; }

.portfolio-journey :is(.section-label, .bento-badge, .bento-cert-verified) {
  color: var(--editorial-accent);
}

.footer p { color: var(--text-secondary); }
.footer p a { color: inherit; text-decoration: underline; }
.footer p a:hover { opacity: 1; }
#projectModal .meta-label { color: var(--text-secondary); }
