/* ==========================================================================
   layout.css — NAV, HERO, GIRIH CANVAS, PORTRAIT, ORIGAMI BAR,
                BIO MANUSCRIPT, MENTORSHIP SLIP, NEWS, DIVIDERS & RESPONSIVE
   ========================================================================== */

/* Skip link (keyboard users) */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent-indigo);
  color: var(--ink-on-accent);
  font-size: 0.82rem;
  font-weight: 500;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 10px;
  color: var(--ink-on-accent);
}

/* ==========================================================================
   STICKY TOP NAVIGATION BAR & UNIFIED 26x26 A.Y. SIGNATURE SEAL
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 2px 0;
}

.brand-btn:hover .ay-seal {
  transform: translateY(-1px) rotate(-1.5deg);
}

/* Unified 26x26 Architectural A.Y. Origami-Hanko Signature Seal */
.ay-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.ay-seal svg {
  width: 26px;
  height: 26px;
  display: block;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link-btn {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.nav-link-btn:hover,
.nav-link-btn[aria-current="true"] {
  color: var(--ink-primary);
  background: var(--bg-surface);
}

.nav-link-btn[aria-current="true"] {
  box-shadow: inset 0 -2px 0 var(--accent-vermilion);
}

.palette-trigger,
.theme-toggle,
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
  transition: all 0.2s ease;
}

.palette-trigger {
  padding: 4px 7px;
}

.palette-trigger kbd {
  border: none;
  background: transparent;
  padding: 0 2px;
  font-size: 0.7rem;
}

.palette-trigger:hover,
.theme-toggle:hover,
.sound-toggle:hover {
  border-color: var(--accent-indigo);
  color: var(--ink-primary);
}

.sound-toggle.active {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: var(--accent-indigo-soft);
}

.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.sound-bars span {
  display: block;
  width: 1.5px;
  background: currentColor;
  border-radius: 1px;
  height: 4px;
}

.sound-toggle:not(.active) .sound-bars span {
  height: 2px;
  opacity: 0.7;
}

.sound-toggle.active .sound-bars span:nth-child(1) { animation: barPulse 1.1s ease-in-out infinite; }
.sound-toggle.active .sound-bars span:nth-child(2) { animation: barPulse 0.85s ease-in-out 0.2s infinite; }
.sound-toggle.active .sound-bars span:nth-child(3) { animation: barPulse 1.25s ease-in-out 0.4s infinite; }

@keyframes barPulse {
  0%, 100% { height: 3px; }
  50% { height: 10px; }
}

/* ==========================================================================
   HERO, AMBIENT GIRIH-KUMIKO CANVAS, PORTRAIT, ORIGAMI BAR
   ========================================================================== */
.hero-section {
  position: relative;
  padding-top: 32px;
  padding-bottom: 12px;
}

.hero-canvas-wrap {
  position: relative;
  width: 100%;
  height: 118px;
  margin-bottom: 26px;
  border-radius: 10px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-paper);
  cursor: crosshair;
}

#girihKumikoCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-caption {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--bg-nav);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-hairline);
  pointer-events: none;
}

/* Opt-in sound invitation on the lattice (hidden once sound is enabled) */
.canvas-sound-hint {
  position: absolute;
  bottom: 8px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  background: var(--bg-nav);
  padding: 2px 9px;
  border-radius: 4px;
  border: 1px dashed var(--border-crease);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.canvas-sound-hint:hover,
.canvas-sound-hint:focus-visible {
  opacity: 1;
  color: var(--accent-vermilion);
  border-color: var(--accent-vermilion);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 32px;
  align-items: start;
  margin-bottom: 26px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.eyebrow.eyebrow-tight {
  margin-bottom: 4px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-vermilion);
  transform: rotate(45deg);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin-bottom: 10px;
}

/* Subtle Diplomatic Navy & Lapis Initial Drop-Cap Coloring */
.hero-init-a {
  color: var(--accent-indigo);
}

.hero-init-y {
  color: var(--accent-vermilion);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.3vw, 1.38rem);
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

/* Prominent Top MLArchSys Co-Founder Callout Strip */
.mlarchsys-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 6px 13px 6px 8px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-crease);
  border-left: 3px solid var(--accent-indigo);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 0.81rem;
  line-height: 1.4;
  box-shadow: var(--shadow-paper);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mlarchsys-strip:hover {
  transform: translateY(-1px);
  border-color: var(--accent-indigo);
  box-shadow: var(--shadow-hover);
  color: var(--ink-primary);
}

.mlarchsys-tag {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-indigo-soft);
  color: var(--accent-indigo);
}

.mlarchsys-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-vermilion);
  white-space: nowrap;
}

.hero-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hero-pill-btn.primary {
  background: var(--accent-indigo);
  color: var(--ink-on-accent);
  border: 1px solid var(--accent-indigo);
}

[data-theme="midnight"] .hero-pill-btn.primary {
  font-weight: 600;
}

.hero-pill-btn.primary:hover {
  color: var(--ink-on-accent);
}

.hero-pill-btn.secondary {
  background: var(--bg-surface-elevated);
  color: var(--ink-primary);
  border: 1px solid var(--border-crease);
  box-shadow: var(--shadow-paper);
}

.hero-pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-vermilion);
}

.hero-pill-btn.secondary:hover {
  color: var(--accent-vermilion);
}

/* Mounted Washi Portrait Frame */
.portrait-mount {
  position: relative;
  background: var(--bg-surface-elevated);
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--border-crease);
  box-shadow: var(--shadow-paper);
  transition: transform 0.28s var(--ease-fold), box-shadow 0.28s ease;
}

.portrait-mount:hover {
  transform: translateY(-3px) rotate(0.6deg);
  box-shadow: var(--shadow-hover);
}

.portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-surface);
}

#hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

/* Identical 26x26 A.Y. Seal on bottom-right corner of portrait */
.portrait-hanko {
  position: absolute;
  bottom: -6px;
  right: -6px;
  padding: 2px;
  border-radius: 6px;
  background: var(--bg-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

/* Origami Social Icon Bar */
.origami-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 30px;
}

.origami-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  color: var(--ink-primary);
  box-shadow: var(--shadow-paper);
  transition: transform 0.26s var(--ease-fold),
              box-shadow 0.26s ease,
              border-color 0.22s ease,
              background-color 0.22s ease;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

/* Subtle folded top-right corner hint */
.origami-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: linear-gradient(225deg, var(--bg-paper) 46%, var(--border-crease) 50%, var(--bg-surface-elevated) 54%);
  opacity: 0.75;
  transition: width 0.22s ease, height 0.22s ease;
}

.origami-card:hover {
  transform: perspective(280px) rotateY(-12deg) translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-indigo);
  background: var(--bg-surface-elevated);
  color: var(--accent-indigo);
}

.origami-card:hover::after {
  width: 15px;
  height: 15px;
}

.origami-card svg {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.origami-label {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
  transition: color 0.2s ease;
}

.origami-card:hover .origami-label {
  color: var(--accent-indigo);
}

/* ==========================================================================
   PERSIAN TERMEH & JAPANESE WASHI WOVEN BIOGRAPHY MANUSCRIPT SHEET
   ========================================================================== */
.bio-manuscript {
  position: relative;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-crease);
  border-radius: 10px;
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}

/* Woven Termeh / Nishijin silk selvedge border top & bottom */
.bio-manuscript::before,
.bio-manuscript::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent-vermilion) 0px,
    var(--accent-vermilion) 10px,
    transparent 10px,
    transparent 14px,
    var(--accent-indigo) 14px,
    var(--accent-indigo) 24px,
    transparent 24px,
    transparent 28px,
    var(--accent-gold) 28px,
    var(--accent-gold) 34px,
    transparent 34px,
    transparent 38px
  );
  opacity: 0.65;
}

.bio-manuscript::before { top: 0; }
.bio-manuscript::after { bottom: 0; }

/* Subtle Persian Boteh + Japanese Asanoha corner filigree watermark */
.manuscript-watermark {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 96px;
  height: 96px;
  color: var(--ink-muted);
  opacity: 0.1;
  pointer-events: none;
}

.bio-prose {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.98rem;
  color: var(--ink-primary);
}

.bio-prose p {
  color: var(--ink-primary);
}

/* Editorial Serif Lead Paragraph */
.bio-prose p.bio-lead {
  font-family: var(--font-serif);
  font-size: 1.16rem;
  line-height: 1.56;
  color: var(--ink-primary);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-hairline);
}

.bio-highlight {
  font-weight: 500;
  color: var(--accent-indigo);
}

/* Interactive Paper Reference Link with Superscript Index */
.bio-ref {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--accent-indigo);
  border-bottom: 1px solid rgba(30, 58, 95, 0.3);
  padding: 0 1px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  border-radius: 3px;
}

.bio-ref:hover {
  color: var(--accent-vermilion);
  border-bottom-color: var(--accent-vermilion);
  background: var(--accent-vermilion-soft);
}

.bio-ref sup {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 0;
  color: var(--accent-vermilion);
  margin-left: 1px;
}

/* Subtle Monospace Impact Metric Pill */
.bio-metric {
  font-family: var(--font-mono);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  white-space: nowrap;
}

.bio-em {
  font-weight: 550;
  color: var(--ink-primary);
}

/* Folded Washi Mentorship Slip */
.washi-slip {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-crease);
  border-left: 3px solid var(--accent-indigo);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-paper);
  margin-bottom: 24px;
}

.washi-slip::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 18px 18px 0;
  border-color: transparent var(--bg-paper) transparent transparent;
  box-shadow: -2px 2px 3px rgba(0, 0, 0, 0.06);
}

.slip-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slip-kicker {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-vermilion);
  font-weight: 600;
}

.slip-body {
  font-size: 0.93rem;
  color: var(--ink-primary);
  font-weight: 450;
}

.slip-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 6px;
  background: var(--accent-indigo);
  color: var(--ink-on-accent);
  font-size: 0.82rem;
  font-weight: 500;
  transition: transform 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

[data-theme="midnight"] .slip-cta {
  font-weight: 600;
}

.slip-cta:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

/* Compact Recent News Timeline */
.recent-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 18px 22px;
}

.sub-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.badge-new {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-indigo);
  color: var(--ink-on-accent);
  text-transform: uppercase;
}

.news-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  min-width: 68px;
}

.news-title {
  color: var(--ink-primary);
}

.news-farsi {
  font-weight: 500;
}

/* ==========================================================================
   SECTION HEADERS & ORIGAMI CREASE DIVIDERS
   ========================================================================== */
.crease-divider {
  margin: 22px 0;
  width: 100%;
  display: block;
}

.section-header {
  margin-bottom: 22px;
}

.section-header.section-header-tight {
  margin-bottom: 14px;
}

.section-header.section-header-tight-lg {
  margin-bottom: 16px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  max-width: 720px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (360px → 1920px, ZERO HORIZONTAL SCROLL)
   ========================================================================== */
@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portrait-mount {
    max-width: 176px;
  }

  .origami-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-caption {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 10px 16px;
  }

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

  .bio-manuscript {
    padding: 18px 16px;
  }

  .palette-trigger {
    display: none;
  }
}
