/* 
 * Toyo Ntewo Portfolio - Editorial Design System 
 * Minimal, spacious, typography-led aesthetic inspired by reference designs.
 */

:root {
  --bg: #fafafa;
  --bg-subtle: #f4f4f5;
  --surface: #ffffff;
  --text-main: #18181b;
  --text-muted: #52525b;
  --text-dim: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #18181b;
  --accent-blue: #2563eb;
  --header-bg: rgba(250, 250, 250, 0.88);
  --selection-bg: #e4e4e7;
  --selection-text: #18181b;
  --shadow-soft: rgba(24, 24, 27, 0.06);
  --shadow-card: rgba(24, 24, 27, 0.1);
  
  --max-width: 860px;
  --max-width-wide: 1040px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101113;
  --bg-subtle: #181a1e;
  --surface: #16181c;
  --text-main: #f2f3f4;
  --text-muted: #b2b5bc;
  --text-dim: #858a94;
  --border: #2c3037;
  --border-strong: #3c424d;
  --accent: #f2f3f4;
  --accent-blue: #60a5fa;
  --header-bg: rgba(16, 17, 19, 0.88);
  --selection-bg: #3c424d;
  --selection-text: #ffffff;
  --shadow-soft: rgba(0, 0, 0, 0.22);
  --shadow-card: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Base Container Layout */
.shell {
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
}

.shell-wide {
  width: min(100% - 48px, var(--max-width-wide));
  margin: 0 auto;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px 0;
  border-bottom: 1px solid rgba(228, 228, 231, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.about-header-actions {
  margin-left: auto;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--border);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.brand-avatar:hover,
.brand-wrapper:hover .brand-avatar {
  background: linear-gradient(135deg, #10b981, #34d399, #059669);
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.brand-signature-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: contrast(1.3) brightness(0.85);
  clip-path: inset(0 0 0 0);
  animation: live-write-signature 2.0s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  transition: transform 0.3s var(--ease);
}

html[data-theme="dark"] .brand-signature-img {
  filter: invert(1) brightness(0.92);
}

.brand-wrapper:hover .brand-signature-img,
.about-breadcrumb:hover .brand-signature-img {
  animation: live-write-signature-hover 1.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  transform: scale(1.05);
}

@keyframes live-write-signature {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0.1;
  }
  10% {
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes live-write-signature-hover {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0.3;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-main);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

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

.theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Hero Intro Section (Editorial Style) */
.hero-editorial {
  padding: 56px 0 64px;
}

.hero-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
}

.hero-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.hero-statement {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 400;
}

.hero-statement strong {
  color: var(--text-main);
  font-weight: 500;
}

.hero-focus {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

.hero-badge-icon {
  width: 14px;
  height: 14px;
}

/* Section Kickers & Headings */
.section-kicker {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: lowercase;
  margin-bottom: 24px;
}

/* My Work Section (Horizontal Scroll Panel / Responsive Grid) */
.section-work {
  padding: 32px 0 64px;
}

.work-cards-scroll {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .work-cards-scroll {
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
  }
}

.work-card {
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  text-decoration: none;
}

.work-card-media {
  width: 100%;
  height: 210px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.work-card:hover .work-card-media {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}

.work-card:hover .work-card-media img {
  transform: scale(1.03);
}

.work-card-info {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.work-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-card-category {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.work-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

.arrow-icon {
  font-size: 14px;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.work-card:hover .arrow-icon {
  transform: translate(2px, -2px);
  color: var(--text-main);
}

/* My Articles Section */
.section-articles {
  padding: 32px 0 64px;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.article-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.article-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.article-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}

.article-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.article-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.article-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Audio Bar (Linkable & Playable Widget) */
.audio-bar-wrapper {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audio-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  font-size: 13px;
  color: var(--text-muted);
  box-shadow: 0 4px 12px var(--shadow-soft);
  transition: all 0.2s var(--ease);
}

.audio-bar:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  transform: translateY(-1px);
}

.audio-disc {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-main);
  display: grid;
  place-items: center;
  position: relative;
}

.audio-disc::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg);
}

.audio-text {
  font-family: var(--font-sans);
}

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

.play-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-main);
}

/* Embedded Audio Player Drawer */
.audio-player-drawer {
  display: none;
  margin-top: 8px;
  max-width: 360px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.audio-player-drawer.open {
  display: block;
}

/* Dedicated About Page Styles */
.about-header {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.back-link:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.about-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Interactive whiteboard collage (About Page) */
.collage-section { margin: 30px 0 48px; }
.collage-reset { position: absolute; top: 14px; right: 14px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-muted); font-size: 20px; line-height: 1; transition: transform 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease); }
@supports (background: color-mix(in srgb, white, black)) {
  .collage-reset { background: color-mix(in srgb, var(--surface) 86%, transparent); }
}
.collage-reset:hover, .collage-reset:focus-visible { border-color: var(--border-strong); color: var(--text-main); transform: rotate(45deg); }
.collage-container { position: relative; width: 100%; min-height: 460px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); isolation: isolate; outline: none; }
.collage-container:focus-visible { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.collage-board-grid { position: absolute; inset: 0; background-image: radial-gradient(var(--border) 0.7px, transparent 0.7px); background-size: 18px 18px; opacity: 0.18; pointer-events: none; }
.collage-items { position: absolute; inset: 0; z-index: 1; }
.collage-item { position: absolute; left: 50%; top: 50%; border-radius: 12px; background: var(--surface); box-shadow: 0 12px 30px -8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04); transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(var(--scale, 1)); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); user-select: none; touch-action: none; cursor: grab; }
.collage-item:hover { --scale: 1.06; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15); }
.collage-item.is-dragging { --scale: 1.04; cursor: grabbing; transition: none; box-shadow: 0 24px 42px -12px rgba(0,0,0,0.2); }
.collage-image { width: 120px; height: 120px; object-fit: contain; background: transparent; box-shadow: none; border-radius: 0; }
.collage-image.portrait { width: 180px; height: 220px; object-fit: cover; border-radius: 12px; box-shadow: 0 12px 30px -8px rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.06); }
.collage-image.gif { width: 160px; height: 136px; padding: 8px; object-fit: cover; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(0,0,0,0.08); }
.collage-image.icon { width: 60px; height: 60px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.18)); }
.collage-image.flag { width: 100px; height: 100px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.18)); }
.collage-image.project { width: 136px; height: 86px; object-fit: cover; border: 6px solid var(--surface); border-radius: 10px; box-shadow: 0 12px 30px -8px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.06); }
.collage-image.size-large { width: 172px; height: 108px; }
.collage-image.size-small { width: 92px; height: 60px; }
.collage-badge.theme-dark { background: #27272a; color: #fff; }
.collage-badge.theme-blue { background: #006BB6; color: #fff; }
.collage-badge:focus-visible, .collage-image:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 5px; }
.collage-badge { padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.collage-badge-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .collage-item { transition: none; }
}

/* Conversational Bio Text */
.about-prose {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
}

.about-prose p strong {
  color: var(--text-main);
}

/* Film Recommendations Section (IMDb Linked) */
.films-section {
  margin: 48px 0;
}

.films-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.film-card {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  aspect-ratio: 2/3;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.film-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 24px -6px rgba(0,0,0,0.12);
}

.film-imdb-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 6px;
  background: rgba(0,0,0,0.75);
  color: #f5c518;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Favorite Albums & Tracks Section */
.albums-section {
  margin: 48px 0 64px;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.album-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

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

.album-cover {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.album-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.album-artist {
  font-size: 12px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

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

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Theme-aware controls and form defaults */
input,
textarea {
  background: var(--surface);
  color: var(--text-main);
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* Project & Filter Pages */
.page-header {
  padding: 48px 0 32px;
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 8px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  margin: 24px 0 36px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.15s ease;
}

.filter-pill.active,
.filter-pill:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

/* Automation Lab Page */
.automation-index {
  padding-bottom: 80px;
}

.automation-index-header {
  padding-bottom: 48px;
}

.automation-list {
  border-top: 1px solid var(--border-strong);
}

.automation-list-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 0.25s var(--ease), color 0.2s ease;
}

.automation-list-item:hover {
  padding-right: 8px;
  color: var(--text-main);
}

.automation-list-item:hover .arrow-icon {
  color: var(--text-main);
  transform: translate(2px, -2px);
}

.automation-list-number,
.automation-list-meta {
  color: var(--text-dim);
  font: 12px var(--font-mono);
}

.automation-list-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.automation-list-heading h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.automation-list-status {
  padding: 3px 7px;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  color: #047857;
  font: 11px var(--font-mono);
  background: #ecfdf5;
}

.automation-list-main p {
  max-width: 620px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.automation-list-meta {
  display: inline-block;
  margin-top: 13px;
}

.automation-index-note {
  max-width: 500px;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border-strong);
}

.automation-index-note p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.automation-page {
  padding: 48px 0 80px;
}

.automation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 72px;
  align-items: end;
  padding: 40px 0 72px;
  border-bottom: 1px solid var(--border);
}

.automation-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font: 12px var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.automation-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.automation-title {
  max-width: 680px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 600;
  text-wrap: balance;
}

.automation-lede {
  max-width: 570px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
}

.automation-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.automation-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--text-main);
  border-radius: var(--radius-sm);
  background: var(--text-main);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.2s ease, color 0.2s ease;
}

.automation-button:hover {
  transform: translateY(-2px);
  background: #3f3f46;
}

.automation-button:active {
  transform: translateY(0) scale(0.98);
}

.automation-button.secondary {
  background: transparent;
  color: var(--text-main);
}

form button[type="submit"] {
  color: var(--bg) !important;
}

.automation-button.secondary:hover {
  background: var(--bg-subtle);
}

.automation-snapshot {
  padding: 22px 0 0;
  border-top: 1px solid var(--border-strong);
}

.automation-snapshot-label {
  color: var(--text-dim);
  font: 11px var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.automation-snapshot h2 {
  margin-top: 14px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.automation-snapshot p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.automation-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.48fr);
  gap: 72px;
  padding-top: 64px;
}

.automation-section + .automation-section {
  margin-top: 54px;
}

.automation-section h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.automation-section p {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.automation-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--border);
  background: var(--border);
}

.automation-step {
  min-height: 150px;
  padding: 18px;
  background: var(--surface);
}

.automation-step-number {
  color: var(--text-dim);
  font: 12px var(--font-mono);
}

.automation-step h3 {
  margin-top: 28px;
  font-size: 15px;
  font-weight: 600;
}

.automation-step p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.automation-aside {
  align-self: start;
  border-top: 1px solid var(--border-strong);
}

.automation-detail {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.automation-detail dt { color: var(--text-dim); }
.automation-detail dd { color: var(--text-main); text-align: right; }

.automation-note {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 768px) {
  .automation-page { padding-top: 24px; }
  .automation-hero, .automation-content { grid-template-columns: 1fr; gap: 42px; }
  .automation-hero { padding: 28px 0 52px; }
  .automation-content { padding-top: 48px; }
}

@media (max-width: 540px) {
  .automation-list-item {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
  }

  .automation-list-heading {
    display: block;
  }

  .automation-list-status {
    display: inline-block;
    margin-top: 8px;
  }

  .automation-flow { grid-template-columns: 1fr; }
  .automation-step { min-height: auto; }
  .automation-step h3 { margin-top: 18px; }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .shell, .shell-wide {
    width: min(100% - 32px, var(--max-width));
  }
  
  .hero-editorial {
    padding: 36px 0 48px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% - 8px);
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 100;
  }

  .header-actions {
    gap: 10px;
  }

  .site-nav.open {
    display: flex;
  }
  
  .films-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .albums-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .collage-container {
    min-height: 340px;
  }
  .collage-image.portrait {
    width: 140px;
    height: 175px;
  }
}

@media (max-width: 540px) {
  .films-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .article-item {
    gap: 12px;
    padding: 12px;
  }

  .article-item-left {
    min-width: 0;
    gap: 12px;
  }

  .article-thumb {
    width: 48px;
    height: 48px;
  }

  .article-meta-info {
    min-width: 0;
  }

  .article-title,
  .article-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .article-item > .arrow-icon { flex: 0 0 auto; }

  .theme-toggle { padding: 6px 8px; }
  .theme-toggle-label { display: none; }
}

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

  .collage-container {
    min-height: 360px;
  }

  .collage-image.portrait {
    width: 122px;
    height: 152px;
  }

  .collage-image.gif {
    width: 126px;
    height: 108px;
  }

  .collage-image.project {
    width: 112px;
    height: 72px;
    border-width: 4px;
  }

  .collage-image.size-large { width: 138px; height: 88px; }
  .collage-image.size-small { width: 78px; height: 52px; }

  .collage-badge {
    padding: 8px 10px;
    font-size: 11px;
  }

  .hero-name {
    font-size: 16px;
  }

  .hero-statement {
    font-size: 15px;
  }
}
