/* ==========================================================================
   SHOMAY SINGH PARIHAR — PERSONAL WEB, AI ENGINEERING & DAILY LOG
   Editorial Typography · Open Hairline Architecture · Latent-Space Canvas
   Optimized for Wide Desktop, Laptop, Tablet & Mobile Viewports
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Deep Obsidian & Atmospheric Surface Palette */
  --bg: #07080c;
  --bg-elevated: rgba(15, 18, 25, 0.72);
  --bg-code: rgba(12, 14, 20, 0.78);

  /* Typography Colors */
  --text: #f3f4f6;
  --text-secondary: #b4bac5;
  --text-muted: #7e8694;
  --text-dim: #545b69;

  /* Atmospheric Accent — Sapphire, Indigo & Cyan */
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-rgb: 59, 130, 246;
  --accent-violet-rgb: 139, 92, 246;
  --accent-cyan-rgb: 6, 182, 212;

  /* Hairlines & Dividers (No Heavy Boxes) */
  --border: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.22);

  /* World-Class Editorial & Technical Font Triad */
  --font-display: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.16s;
  --duration-normal: 0.28s;
}

/* Light Mode — Warm Archival Paper & Deep Ink */
body.light {
  --bg: #f7f6f2;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --bg-code: rgba(238, 236, 230, 0.85);

  --text: #121418;
  --text-secondary: #373c46;
  --text-muted: #5f6672;
  --text-dim: #8a919e;

  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-rgb: 37, 99, 235;
  --accent-violet-rgb: 109, 40, 217;
  --accent-cyan-rgb: 8, 145, 178;

  --border: rgba(18, 20, 24, 0.11);
  --border-subtle: rgba(18, 20, 24, 0.06);
  --border-strong: rgba(18, 20, 24, 0.28);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.68;
  overflow-x: hidden;
  width: 100%;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

::selection {
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* Subtle Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 14px;
  z-index: 100000;
  transition: top var(--duration-normal) var(--ease);
}
.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   3. ATMOSPHERIC BACKGROUND & WEBGL CANVAS
   -------------------------------------------------------------------------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

body.light #bg-canvas {
  opacity: 0.42;
  mix-blend-mode: multiply;
}

.ambient-glow-mesh {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.18;
  mix-blend-mode: screen;
  will-change: transform;
}

body.light .glow-orb {
  opacity: 0.11;
  mix-blend-mode: multiply;
  filter: blur(150px);
}

.orb-1 {
  top: -8%;
  right: 4%;
  width: min(560px, 48vw);
  height: min(560px, 48vw);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.85) 0%, transparent 72%);
  animation: orb-drift-1 26s ease-in-out infinite alternate;
}

.orb-2 {
  top: 32%;
  left: -8%;
  width: min(620px, 52vw);
  height: min(620px, 52vw);
  background: radial-gradient(circle, rgba(var(--accent-violet-rgb), 0.78) 0%, transparent 72%);
  animation: orb-drift-2 30s ease-in-out infinite alternate;
}

.orb-3 {
  bottom: 12%;
  right: 8%;
  width: min(500px, 46vw);
  height: min(500px, 46vw);
  background: radial-gradient(circle, rgba(var(--accent-cyan-rgb), 0.7) 0%, transparent 72%);
  animation: orb-drift-3 28s ease-in-out infinite alternate;
}

.orb-4 {
  bottom: -8%;
  left: 18%;
  width: min(440px, 42vw);
  height: min(440px, 42vw);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.65) 0%, transparent 72%);
  animation: orb-drift-1 24s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-45px, 55px) scale(1.08); }
  100% { transform: translate(35px, -35px) scale(0.95); }
}

@keyframes orb-drift-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(55px, -45px) scale(1.06); }
  100% { transform: translate(-35px, 45px) scale(0.96); }
}

@keyframes orb-drift-3 {
  0% { transform: translate(0, 0) scale(0.96); }
  50% { transform: translate(-45px, -35px) scale(1.1); }
  100% { transform: translate(45px, 25px) scale(1.02); }
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION (MINIMAL HAIRLINE BAR)
   -------------------------------------------------------------------------- */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  z-index: 1000;
  background: rgba(7, 8, 12, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--duration-normal) var(--ease), border-color var(--duration-normal) var(--ease);
}

body.light #nav {
  background: rgba(247, 246, 242, 0.82);
}

#nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(7, 8, 12, 0.92);
}

body.light #nav.scrolled {
  background: rgba(247, 246, 242, 0.95);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.15rem, 2.2vw, 2rem);
}

.nav-links a {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--text);
}

.nav-external {
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
  color: var(--text-secondary) !important;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-link {
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.nav-icon-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

#theme-toggle {
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--duration-fast);
}
#theme-toggle:hover {
  color: var(--text);
}

#sun { display: block; }
#moon { display: none; }
body.light #sun { display: none; }
body.light #moon { display: block; }

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--duration-normal) var(--ease);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(3.75px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. EDITORIAL CONTAINERS & GRID ARCHITECTURE
   -------------------------------------------------------------------------- */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding-left: clamp(1.25rem, 5vw, 4rem);
  padding-right: clamp(1.25rem, 5vw, 4rem);
  width: 100%;
}

.section-space {
  padding-top: clamp(4rem, 8.5vw, 7.25rem);
  padding-bottom: clamp(4rem, 8.5vw, 7.25rem);
  border-top: 1px solid var(--border);
}

.editorial-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.editorial-main {
  min-width: 0;
  width: 100%;
}

.editorial-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
}

.section-title em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-secondary);
}

.sidebar-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.62;
  margin-top: 0.25rem;
}

.sidebar-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  width: fit-content;
}
.sidebar-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   6. HERO SECTION
   -------------------------------------------------------------------------- */
#hero,
.page-hero {
  padding-top: clamp(6.75rem, 15vh, 11rem);
  padding-bottom: clamp(3.5rem, 8vh, 6rem);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.2vw, 0.78rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}

.meta-sep {
  color: var(--text-dim);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.2vw, 5.1rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 18ch;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 5vw, 4.5rem);
  align-items: end;
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--border);
}

.hero-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 1.45vw, 1.3rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 60ch;
}

.hero-lead strong {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.94em;
  color: var(--text);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.5rem;
}

.link-primary {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 4px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.link-primary:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.link-quiet {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
}
.link-quiet:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   7. ABOUT & DISCIPLINES
   -------------------------------------------------------------------------- */
.portrait-figure {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portrait-img {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 4 / 4.8;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(18%) contrast(1.03);
  transition: filter var(--duration-normal) var(--ease);
}
.portrait-figure:hover .portrait-img {
  filter: grayscale(0%) contrast(1);
}

.portrait-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.portrait-caption span {
  color: var(--text-dim);
}

.prose-large {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.prose-large p {
  font-size: clamp(0.98rem, 1.1vw, 1.06rem);
  line-height: 1.78;
  color: var(--text-secondary);
  max-width: 68ch;
}

.inline-anchor {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}
.inline-anchor:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.discipline-list {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.discipline-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}

.discipline-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.discipline-desc {
  font-size: 0.95rem;
  line-height: 1.68;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. SELECTED WORK (EDITORIAL CASE ROWS, NO CARDS/BOXES)
   -------------------------------------------------------------------------- */
.work-list {
  display: flex;
  flex-direction: column;
}

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.85fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.work-row:first-child {
  padding-top: 0;
}

.work-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.work-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-heading {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
}

.work-title-btn {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color var(--duration-fast);
}
.work-title-btn:hover {
  color: var(--accent);
}

.work-summary {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.work-stack-line {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 0.2rem;
  overflow-wrap: break-word;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.35rem;
  margin-top: 0.45rem;
}

.btn-text-trigger,
.work-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.btn-text-trigger:hover,
.work-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.work-row-visual {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-code);
}

.work-row-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 0.5s var(--ease), opacity var(--duration-normal);
}

.work-row:hover .work-row-visual img {
  transform: scale(1.03);
  opacity: 1;
}

.section-footer-link {
  padding-top: 2.25rem;
}

/* --------------------------------------------------------------------------
   9. PERSONAL JOURNAL / DAILY LOG STREAM (journal.html)
   -------------------------------------------------------------------------- */
.journal-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 0.5rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.journal-stream {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.journal-entry {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

.journal-entry:first-child {
  padding-top: 0;
}

.journal-entry[hidden] {
  display: none !important;
}

.entry-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.entry-date {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.entry-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.18;
  color: var(--text);
}

.entry-prose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry-prose p {
  font-family: var(--font-serif);
  font-size: clamp(1.04rem, 1.2vw, 1.12rem);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 66ch;
}

/* Journal Photo Gallery */
.entry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.entry-figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.entry-figure img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity var(--duration-fast);
}
.entry-figure img:hover {
  opacity: 0.92;
}

.entry-figcaption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Journal Video / Screen Recording */
.entry-video-wrap {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-video-wrap video,
.entry-video-wrap img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  background: var(--bg-code);
}

/* Custom Minimal Audio / Voice Note Player */
.entry-audio {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 0.25rem;
}

.audio-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.audio-play-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.audio-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.audio-title {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.audio-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  cursor: pointer;
}

.wave-bar {
  flex: 1;
  background: var(--border-strong);
  height: 35%;
  min-width: 2px;
  transition: height 0.2s ease, background-color 0.15s ease;
}

.wave-bar.played {
  background: var(--accent);
}

.entry-audio.playing .wave-bar {
  animation: wave-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes wave-pulse {
  0% { transform: scaleY(0.65); }
  100% { transform: scaleY(1.35); }
}

/* Journal Code Block */
.entry-code {
  margin-top: 0.35rem;
  background: var(--bg-code);
  border-left: 2px solid var(--accent);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.entry-code-header {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.entry-code pre {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   10. TECHNICAL SPECIFICATION TABLE (STACK)
   -------------------------------------------------------------------------- */
.spec-table {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.spec-row:first-child {
  padding-top: 0;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
}

.spec-value {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   11. CONTACT SECTION (MINIMAL HAIRLINE CHANNELS & FORM)
   -------------------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.06rem, 1.3vw, 1.16rem);
  line-height: 1.68;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-channels {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.channel-name {
  color: var(--text-muted);
  flex-shrink: 0;
}

.channel-val {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
  transition: color var(--duration-fast);
}

.channel-row:hover .channel-val {
  color: var(--accent);
}

.contact-form-clean {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.clean-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clean-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.clean-field input,
.clean-field textarea {
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 0;
  font-size: 0.96rem;
  color: var(--text);
  border-radius: 0;
  width: 100%;
  transition: border-color var(--duration-fast);
}

.clean-field input::placeholder,
.clean-field textarea::placeholder {
  color: var(--text-dim);
}

.clean-field input:focus,
.clean-field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.contact-submit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-top: 0.25rem;
}

.btn-minimal {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 4px;
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.btn-minimal:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

#form-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-brand {
  color: var(--text);
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.back-top:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   13. PROJECT ARCHITECTURE MODAL & IMAGE LIGHTBOX
   -------------------------------------------------------------------------- */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease), visibility var(--duration-normal);
}

.project-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 9, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-wrapper {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: 90dvh;
  z-index: 2;
  display: flex;
}

.modal-card {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-close-btn:hover {
  color: var(--text);
}

.modal-header-top {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-right: 42px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.15;
  margin-top: 0.35rem;
}

.modal-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.35rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.modal-image-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-code);
}
.modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-summary-box p {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.modal-section-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.modal-features-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
}

.modal-feature-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}

.modal-feature-row h5 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
}

.modal-feature-row p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-arch-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 0.85rem 1rem;
  background: var(--bg-code);
  border-left: 2px solid var(--accent);
  overflow-wrap: break-word;
}

.modal-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  padding-top: 0.25rem;
}

/* Lightbox */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(5, 6, 9, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease), visibility var(--duration-normal);
}

.media-lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.media-lightbox img {
  max-width: 92vw;
  max-height: 80dvh;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 65ch;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   14. DESKTOP WIDE-SCREEN & MOBILE/TABLET BREAKPOINTS
   -------------------------------------------------------------------------- */

/* Large Desktop Monitors (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1280px;
  }
  .editorial-grid {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 6rem;
  }
}

/* Tablet & Compact Laptop (<= 960px) */
@media (max-width: 960px) {
  .editorial-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .editorial-sidebar {
    position: static;
  }

  /* Compact horizontal portrait layout on tablet & mobile */
  .portrait-figure {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
  }

  .portrait-img {
    width: 92px;
    max-width: 92px;
    aspect-ratio: 1 / 1.1;
    flex-shrink: 0;
  }

  /* Horizontal swipeable filter strip on tablet & mobile */
  .journal-filters {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.35rem;
    width: 100%;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .journal-filters::-webkit-scrollbar {
    display: none;
  }

  .hero-intro-grid,
  .contact-layout,
  .modal-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.85rem;
  }

  .work-row {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .work-row-visual {
    order: -1;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }
}

/* Mobile Viewports (<= 768px) */
@media (max-width: 768px) {
  .hide-sm {
    display: none;
  }

  #nav {
    height: 60px;
    padding: 0 1.25rem;
    background: rgba(7, 8, 12, 0.94);
  }

  body.light #nav {
    background: rgba(247, 246, 242, 0.96);
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: calc(100dvh - 60px);
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.25rem 3rem;
    gap: 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-family: var(--font-display);
    font-size: 1.85rem;
    color: var(--text);
    width: 100%;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-links a.active {
    color: var(--accent);
  }

  .nav-external {
    font-family: var(--font-mono) !important;
    font-size: 0.9rem !important;
    margin-top: 0.75rem;
    border-bottom: none !important;
  }

  .mobile-menu-btn {
    display: flex;
    width: 44px;
    height: 44px;
  }

  #theme-toggle {
    width: 44px;
    height: 44px;
  }

  #hero,
  .page-hero {
    padding-top: 6.25rem;
    padding-bottom: 3rem;
  }

  .section-space {
    padding-top: 3.25rem;
    padding-bottom: 3.25rem;
  }

  .discipline-row,
  .spec-row,
  .modal-feature-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.15rem 0;
  }

  .work-row {
    padding: 2.15rem 0;
  }

  /* Prevent iOS input zoom */
  .clean-field input,
  .clean-field textarea {
    font-size: 16px;
  }

  .audio-play-btn {
    width: 42px;
    height: 42px;
  }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .hero-title {
    font-size: clamp(2.15rem, 9.2vw, 2.8rem);
    line-height: 1.08;
  }

  .hero-links {
    gap: 0.75rem 1.15rem;
  }

  .channel-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .channel-val {
    text-align: left;
  }

  .audio-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .audio-title {
    white-space: normal;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
