/* ============================================================
   Faiez Portfolio Theme — Dark Developer Aesthetic
   ============================================================ */

:root {
  /* Comfort palette — warm charcoal, cream headings, soft amber accent */
  --bg:           #1a1817;
  --bg-subtle:    #24201d;
  --bg-hover:     #2c2724;
  --border:       #37322c;
  --text:         #cfc7bd;
  --text-muted:   #8d8478;
  --text-heading: #f3ece3;
  --accent:       #e3b17d;
  --accent-dim:   rgba(227, 177, 125, 0.10);
  --green:        #8fbf87;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius:       6px;
  --max-w:        700px;
  --ease:         0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:              var(--bg);
  color:                   var(--text);
  font-family:             var(--font-sans);
  font-size:               16px;
  line-height:             1.75;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 1.5rem;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  color:       var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }

p { margin-bottom: 1rem; color: var(--text); }

a {
  color:      var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: #f0cd9f; }

strong { color: var(--text-heading); font-weight: 600; }
em     { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

ul, ol {
  margin: 0.5rem 0 1rem 1.4rem;
}
li { margin-bottom: 0.3rem; }

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Code ───────────────────────────────────────────────── */
code {
  font-family:   var(--font-mono);
  font-size:     0.87em;
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: 3px;
  padding:       0.1em 0.4em;
  color:         var(--accent);
}

pre {
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.25rem;
  overflow-x:    auto;
  margin:        1.5rem 0;
}
pre code {
  background: none;
  border:     none;
  padding:    0;
  color:      var(--text);
  font-size:  0.9em;
}

/* ── Header & Nav ───────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding:       1rem 0;
  margin-bottom: 3rem;
  position:      sticky;
  top:           0;
  background:    var(--bg);
  z-index:       10;
  backdrop-filter: blur(8px);
}

nav {
  display:     flex;
  align-items: center;
  gap:         0.15rem;
  flex-wrap:   wrap;
}

.nav-home {
  font-family:  var(--font-mono);
  font-size:    0.92rem;
  color:        var(--accent);
  margin-right: auto;
  font-weight:  500;
  padding:      0.25rem 0;
}
.nav-home:hover { color: #f0cd9f; }

nav a:not(.nav-home) {
  color:         var(--text-muted);
  font-size:     0.88rem;
  padding:       0.25rem 0.6rem;
  border-radius: var(--radius);
  transition:    color var(--ease), background var(--ease);
}
nav a:not(.nav-home):hover,
nav a.active {
  color:      var(--text);
  background: var(--bg-subtle);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 4.5rem 0 5rem;
}

.hero-prefix {
  font-family:   var(--font-mono);
  color:         var(--accent);
  font-size:     0.88rem;
  margin-bottom: 1rem;
  opacity:       0.7;
}

.hero h1 {
  font-size:     clamp(1.9rem, 5vw, 2.8rem);
  color:         var(--text-heading);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  color:         var(--text-muted);
  font-size:     1.05rem;
  margin-bottom: 2.5rem;
}

.hero-links {
  display:   flex;
  gap:       0.6rem;
  flex-wrap: wrap;
}

.hero-links a {
  font-family:   var(--font-mono);
  font-size:     0.85rem;
  color:         var(--text-muted);
  border:        1px solid var(--border);
  padding:       0.4rem 0.9rem;
  border-radius: var(--radius);
  transition:    color var(--ease), border-color var(--ease), background var(--ease);
}
.hero-links a:hover {
  color:        var(--accent);
  border-color: var(--accent);
  background:   var(--accent-dim);
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  margin-bottom:  2.5rem;
  padding-bottom: 1.5rem;
  border-bottom:  1px solid var(--border);
}
.page-header h1 { font-size: 1.6rem; }
.page-header .page-desc {
  color:      var(--text-muted);
  margin-top: 0.4rem;
  font-size:  0.95rem;
}

/* ── Skills ─────────────────────────────────────────────── */
.skills-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap:                   1rem;
}

.skill-category {
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.2rem;
  transition:    border-color var(--ease);
}
.skill-category:hover { border-color: #4a423a; }

.skill-category h3 {
  font-family:    var(--font-mono);
  font-size:      0.78rem;
  color:          var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin:         0 0 0.8rem;
}

.skill-tags {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.35rem;
}

.tag {
  font-family:   var(--font-mono);
  font-size:     0.78rem;
  background:    var(--bg-hover);
  border:        1px solid var(--border);
  border-radius: 3px;
  padding:       0.15rem 0.5rem;
  color:         var(--text);
}

/* ── Experience (tabbed) ────────────────────────────────── */
.exp-tabs {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:                   0.4rem;
  margin:                1.5rem 0 2rem;
  padding-bottom:        0.75rem;
  border-bottom:         1px solid var(--border);
}

.exp-tab {
  flex:            0 0 auto;
  display:         flex;
  flex-direction:  column;
  gap:             0.1rem;
  align-items:     flex-start;
  padding:         0.5rem 0.9rem;
  border:          1px solid transparent;
  border-radius:   var(--radius);
  background:      transparent;
  color:           var(--text);
  font-family:     inherit;
  font-size:       0.85rem;
  line-height:     1.3;
  text-align:      left;
  cursor:          pointer;
  transition:      background var(--ease), color var(--ease), border-color var(--ease);
}

.exp-tab:hover {
  background: var(--bg-subtle);
  color:      var(--text);
}

.exp-tab:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}

.exp-tab.is-active {
  background:    var(--accent-dim);
  border-color:  var(--border);
  color:         var(--text-heading);
}

.exp-tab-company {
  font-weight: 600;
  white-space: nowrap;
}

.exp-tab-period {
  font-family: var(--font-mono);
  font-size:   0.68rem;
  color:       var(--text-muted);
  letter-spacing: 0.02em;
}

.exp-tab.is-active .exp-tab-period { color: var(--accent); }

/* Panels: only the active one shows, and only once JS is running so
   no-JS visitors still get every role's content. */
.exp-panels { margin-top: 0.5rem; }

.exp-tabs-on .exp-panel { display: none; }
.exp-tabs-on .exp-panel.is-active { display: block; }

@keyframes exp-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .exp-tabs-on .exp-panel.is-active {
    animation: exp-panel-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

.exp-head { margin-bottom: 1.25rem; }

.exp-role {
  font-size:   1.35rem;
  margin:      0;
  line-height: 1.3;
}

.exp-org {
  font-family: var(--font-mono);
  font-size:   0.83rem;
  color:       var(--accent);
  margin:      0.25rem 0 0;
}

.exp-dates {
  font-family: var(--font-mono);
  font-size:   0.78rem;
  color:       var(--text-muted);
  margin:      0.2rem 0 0;
}

.exp-meta {
  display:               grid;
  grid-template-columns: max-content 1fr;
  gap:                   0.35rem 1rem;
  margin:                1rem 0 1.75rem;
  padding:               0.9rem 1rem;
  background:            var(--bg-subtle);
  border:                1px solid var(--border);
  border-radius:         var(--radius);
  font-size:             0.82rem;
}

.exp-meta-row { display: contents; }

.exp-meta dt {
  font-family: var(--font-mono);
  font-size:   0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color:       var(--text-muted);
  padding-top: 0.1rem;
}

.exp-meta dd {
  margin:      0;
  color:       var(--text);
  line-height: 1.55;
}

.exp-section { margin-bottom: 1.9rem; }
.exp-section:last-child { margin-bottom: 0; }

.exp-section-title {
  font-family:    var(--font-mono);
  font-size:      0.72rem;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color:          var(--text-muted);
  margin:         0 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom:  1px solid var(--border);
}

.exp-project { margin-bottom: 1.25rem; }
.exp-project:last-child { margin-bottom: 0; }

.exp-project-name {
  font-size:     0.92rem;
  font-weight:   600;
  color:         var(--text-heading);
  margin:        0 0 0.45rem;
}

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

.exp-tasks li {
  position:      relative;
  padding-left:  1.1rem;
  margin-bottom: 0.4rem;
  font-size:     0.9rem;
  line-height:   1.65;
  color:         var(--text);
}

.exp-tasks li::before {
  content:     '›';
  position:    absolute;
  left:        0;
  color:       var(--accent);
  font-weight: 600;
}

.exp-tasks li:last-child { margin-bottom: 0; }

/* ── Blog list ──────────────────────────────────────────── */
.blog-list { margin-top: 0.5rem; }

.post-item {
  display:         flex;
  align-items:     baseline;
  gap:             1rem;
  padding:         0.9rem 0.5rem;
  border-bottom:   1px solid var(--border);
  border-radius:   var(--radius);
  text-decoration: none;
  transition:      background var(--ease);
}
.post-item:first-child { padding-top: 0.5rem; }
.post-item:hover { background: var(--bg-subtle); }

.post-date {
  font-family: var(--font-mono);
  font-size:   0.78rem;
  color:       var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition:  transform var(--ease);
}

.post-title {
  color:      var(--text);
  font-size:  0.97rem;
  transition: color var(--ease), transform var(--ease);
}
.post-item:hover .post-title { color: var(--accent); }

/* Nudge content on hover via transform (compositor-only; no layout thrash). */
@media (prefers-reduced-motion: no-preference) {
  .post-item:hover .post-date,
  .post-item:hover .post-title { transform: translateX(0.4rem); }
}

.empty-state {
  color:       var(--text-muted);
  font-family: var(--font-mono);
  font-size:   0.9rem;
  padding:     1.5rem 0;
}

/* ── Single post ────────────────────────────────────────── */
.post-header {
  margin-bottom:  2.5rem;
  padding-bottom: 1.5rem;
  border-bottom:  1px solid var(--border);
}
.post-header h1 { font-size: 1.7rem; letter-spacing: -0.01em; }

.post-meta {
  font-family: var(--font-mono);
  font-size:   0.8rem;
  color:       var(--text-muted);
  margin-top:  0.5rem;
}

.post-content { line-height: 1.8; }
.post-content h2 { font-size: 1.25rem; }
.post-content p  { color: var(--text); }

/* ── Tables (post content) ──────────────────────────────── */
.post-content table {
  width:           100%;
  border-collapse: collapse;
  margin:          1.5rem 0;
  font-size:       0.86rem;
  display:         block;
  overflow-x:      auto;
  white-space:     nowrap;
}

.post-content thead { border-bottom: 1px solid var(--border); }

.post-content th {
  text-align:     left;
  font-family:    var(--font-mono);
  font-size:      0.72rem;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color:          var(--text-muted);
  padding:        0.5rem 0.9rem 0.5rem 0;
  border-bottom:  1px solid var(--border);
}

.post-content td {
  padding:        0.5rem 0.9rem 0.5rem 0;
  border-bottom:  1px solid var(--bg-subtle);
  color:          var(--text);
  vertical-align: top;
  white-space:    normal;
}

.post-content tbody tr:last-child td { border-bottom: none; }
.post-content tbody tr:hover td { background: var(--bg-subtle); }

.post-content td code,
.post-content th code { white-space: nowrap; }

/* ── Images (post content) ──────────────────────────────── */
.post-content img {
  display:       block;
  max-width:     100%;
  height:        auto;
  margin:        1.5rem 0;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  background:    var(--bg-subtle);
}

.post-content figure { margin: 1.5rem 0; }
.post-content figure img { margin: 0; }

.post-content figcaption {
  font-family: var(--font-mono);
  font-size:   0.72rem;
  color:       var(--text-muted);
  margin-top:  0.6rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .post-content table { font-size: 0.82rem; }
  .post-content th,
  .post-content td { padding-right: 0.75rem; }
}

.back-link {
  display:     inline-flex;
  align-items: center;
  gap:         0.4rem;
  font-family: var(--font-mono);
  font-size:   0.83rem;
  color:       var(--text-muted);
  margin-top:  3rem;
  transition:  color var(--ease);
}
.back-link:hover { color: var(--accent); }

/* ── Contact ────────────────────────────────────────────── */
.contact-section { margin-top: 0.5rem; }

.contact-item {
  display:         flex;
  align-items:     center;
  gap:             0.75rem;
  padding:         0.9rem 1.1rem;
  background:      var(--bg-subtle);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  margin-bottom:   0.65rem;
  transition:      border-color var(--ease), background var(--ease);
  text-decoration: none;
}
.contact-item:hover {
  border-color: var(--accent);
  background:   var(--accent-dim);
}

.contact-label {
  font-family:  var(--font-mono);
  font-size:    0.78rem;
  color:        var(--text-muted);
  width:        72px;
  flex-shrink:  0;
}

.contact-value {
  color:     var(--text);
  font-size: 0.95rem;
  flex:      1;
}

.contact-arrow {
  color:     var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--ease);
}
.contact-item:hover .contact-arrow { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding:    2rem 0;
  margin-top: 5rem;
}

.footer-inner {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  flex-wrap:       wrap;
  gap:             0.5rem;
}

.footer-text {
  font-family: var(--font-mono);
  font-size:   0.78rem;
  color:       var(--text-muted);
}

.footer-link {
  transition: color var(--ease);
}
.footer-link:hover { color: var(--accent); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar            { width: 7px; height: 7px; }
::-webkit-scrollbar-track      { background: var(--bg); }
::-webkit-scrollbar-thumb      { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4a423a; }

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: rgba(227, 177, 125, 0.22);
  color:      var(--text-heading);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  header { margin-bottom: 2rem; }

  nav a:not(.nav-home) {
    font-size: 0.82rem;
    padding:   0.2rem 0.45rem;
  }

  .hero          { padding: 2.5rem 0 3.5rem; }
  .skills-grid   { grid-template-columns: 1fr 1fr; }
  .post-date     { display: none; }
}

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

/* ── Scroll sequence page ───────────────────────────────── */
.container-wide {
  max-width: none;
  padding: 0;
}

.story-page {
  --story-header-height: 5rem;
  --story-footer-height: 5rem;
}

.story-page > header {
  height: var(--story-header-height);
  margin: 0;
  padding: 0.65rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

.story-page > header .container,
.story-page > footer .container {
  max-width: 1100px;
}

.story-page > header .container,
.story-page > header nav {
  height: 100%;
}

.story-page > header nav {
  flex-wrap: nowrap;
}

.story-page > main {
  padding-top: var(--story-header-height);
  padding-bottom: var(--story-footer-height);
}

.story-page > footer {
  align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  bottom: 0;
  display: flex;
  height: var(--story-footer-height);
  margin: 0;
  padding: 0;
  position: fixed;
  width: 100%;
  z-index: 10;
}

.story-page .footer-inner {
  min-height: var(--story-footer-height);
}

.visually-hidden {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.scroll-story {
  overflow: clip;
}

.story-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.scroll-sequence {
  height: 500vh;
  position: relative;
}

.scroll-sequence__sticky {
  align-items: center;
  display: flex;
  height: calc(100vh - var(--story-header-height) - var(--story-footer-height));
  justify-content: center;
  padding: 1rem clamp(1rem, 5vw, 4rem) 2.5rem;
  position: sticky;
  top: var(--story-header-height);
}

@supports (height: 100svh) {
  .scroll-sequence__sticky {
    height: calc(100svh - var(--story-header-height) - var(--story-footer-height));
  }
}

.scroll-sequence__figure {
  background: #e5f1f2;
  inset: 0;
  margin: 0 auto;
  overflow: hidden;
  position: absolute;
  width: 100%;
}

.scroll-sequence__frame {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.scroll-sequence__figure::after {
  background:
    linear-gradient(90deg, rgba(10, 17, 22, 0.74), rgba(10, 17, 22, 0.22) 48%, rgba(10, 17, 22, 0.38)),
    linear-gradient(0deg, rgba(10, 17, 22, 0.44), transparent 34%);
  content: '';
  inset: 0;
  position: absolute;
}

.scroll-sequence__copy {
  align-items: center;
  display: flex;
  max-width: 1100px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.scroll-sequence__copy--right {
  justify-content: flex-end;
}

.scroll-sequence__panel {
  animation: story-panel-enter 360ms ease both;
  background: rgba(17, 24, 29, 0.78);
  border: 1px solid rgba(243, 236, 227, 0.2);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
  max-width: 390px;
  padding: clamp(1.25rem, 3vw, 2rem);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.scroll-sequence__panel[hidden] {
  display: none;
}

.scroll-sequence__panel .story-kicker {
  margin-bottom: 0.8rem;
}

.scroll-sequence__panel h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
  margin: 0 0 0.8rem;
}

.scroll-sequence__panel > p:last-child {
  color: rgba(243, 236, 227, 0.78);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

@keyframes story-panel-enter {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-sequence__progress {
  align-items: center;
  bottom: 0.9rem;
  color: var(--text-muted);
  display: flex;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  gap: 1rem;
  left: clamp(1rem, 5vw, 4rem);
  margin: 0 auto;
  max-width: 1100px;
  position: absolute;
  right: clamp(1rem, 5vw, 4rem);
  z-index: 1;
}

.scroll-sequence__frame-count {
  color: var(--accent);
  flex: 0 0 auto;
}

.scroll-sequence__track {
  background: var(--border);
  border-radius: 99px;
  flex: 1;
  height: 2px;
  overflow: hidden;
}

.scroll-sequence__track span {
  background: var(--accent);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.scroll-sequence__hint {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .story-page {
    --story-header-height: 6rem;
    --story-footer-height: 4.25rem;
  }

  .story-page > header {
    padding: 0.5rem 0;
  }

  .story-page > header nav {
    flex-wrap: wrap;
    gap: 0;
  }

  .story-page > header .nav-home {
    margin-right: 0.5rem;
  }

  .story-page nav a:not(.nav-home) {
    font-size: 0.76rem;
    padding: 0.2rem 0.35rem;
  }

  .scroll-sequence {
    height: 300vh;
  }

  .scroll-sequence__sticky {
    height: calc(100vh - var(--story-header-height) - var(--story-footer-height));
    justify-content: flex-start;
    padding: 1rem 1rem 2.5rem;
    top: var(--story-header-height);
  }

  @supports (height: 100svh) {
    .scroll-sequence__sticky {
      height: calc(100svh - var(--story-header-height) - var(--story-footer-height));
    }
  }

  .scroll-sequence__frame {
    object-position: 58% center;
  }

  .scroll-sequence__figure::after {
    background:
      linear-gradient(0deg, rgba(10, 17, 22, 0.8), rgba(10, 17, 22, 0.08) 75%),
      linear-gradient(90deg, rgba(10, 17, 22, 0.16), rgba(10, 17, 22, 0.08));
  }

  .scroll-sequence__copy {
    align-items: flex-end;
    height: 100%;
    justify-content: center;
    padding-bottom: 1rem;
  }

  .scroll-sequence__panel {
    max-width: 100%;
    padding: 1.1rem 1.2rem;
  }

  .scroll-sequence__panel h2 {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
  }

  .scroll-sequence__panel > p:last-child {
    font-size: 0.88rem;
  }

  .scroll-sequence__progress {
    bottom: 1rem;
    left: 1rem;
    gap: 0.6rem;
    font-size: 0.62rem;
    right: 1rem;
    width: auto;
  }

  .scroll-sequence__hint {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .scroll-sequence__panel {
    animation: none;
  }
}

/* ── Comment Section ────────────────────────────────────── */
.comment-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comment-section h3 {
  font-size: 1.2rem;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
}

.comment-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--ease);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form button {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--accent);
  color: #2a2118;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--ease);
}

.comment-form button:hover {
  opacity: 0.9;
}

.comment-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-status {
  font-size: 0.88rem;
  font-family: var(--font-mono);
  margin-top: 0.5rem;
}

.comment-status.success {
  color: var(--green);
}

.comment-status.error {
  color: #e0937f;
}

/* Brands Marquee */
.brands-marquee-container {
  margin-top: 3rem;
  padding-top: 2rem;
  /* Reverted to match site background */
}

.brands-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-heading); /* comfort cream */
  font-family: var(--font-sans, sans-serif);
  letter-spacing: 0.5px;
}

.brands-marquee {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  background: #f4efe6; /* Warm cream, softer than stark white */
  border-top: 1px solid #e6ddd0;
  border-bottom: 1px solid #e6ddd0;
  padding: 2rem 0;
}

.brands-track {
  display: inline-block;
  animation: marquee 25s linear infinite;
}

.brands-marquee:hover .brands-track {
  animation-play-state: paused;
}

.brand-item-img {
  display: inline-block;
  height: 40px;
  width: auto;
  margin: 0 2rem;
  vertical-align: middle;
  /* Removed grayscale so logos show original color */
  transition: transform 0.3s ease;
}

.brand-item-img:hover {
  transform: scale(1.1);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================================
   Motion layer — compositor-only, progressive enhancement.
   No JS. Scroll reveals use native scroll-driven animations.
   ============================================================ */

@keyframes rise-in {
  from { transform: translateY(14px); }
  to   { transform: translateY(0); }
}

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance — h1 is transform-only so the LCP paint is never delayed. */
  .hero-prefix   { animation: fade-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero h1       { animation: rise-in   0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero .tagline { animation: fade-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
  .hero-links    { animation: fade-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both; }

  /* Scroll reveals — native `view()` timeline, zero JS, no-op where unsupported. */
  @supports (animation-timeline: view()) {
    .brands-title,
    .skill-category,
    .post-item,
    .contact-item {
      animation: fade-rise linear both;
      animation-timeline: view();
      animation-range: entry 8% entry 42%;
    }
  }
}

/* JS fallback (js/reveal.js) for browsers without scroll-driven
   animations — armed only when motion is allowed and IO is available. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-armed .brands-title,
  .reveal-armed .skill-category,
  .reveal-armed .post-item,
  .reveal-armed .contact-item { opacity: 0; }

  .reveal-armed .reveal-in {
    animation: fade-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

/* ── Keyboard focus ring ────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}
.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline:        2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Reduced motion: final state instantly, marquee frozen ─ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero-prefix,
  .hero h1,
  .hero .tagline,
  .hero-links,
  .brands-title,
  .skill-category,
  .post-item,
  .contact-item {
    animation: none !important;
    opacity:   1 !important;
    transform: none !important;
  }

  .brands-track     { animation: none !important; }
  .brands-marquee   { overflow-x: auto; }
  .brand-item-img           { transition: none; }
  .brand-item-img:hover     { transform: none; }
}
