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

/* Accessibility - Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
}

/* Theme */
html, body {
  height: 100%;
}
body {
  background-color: #000;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
.hero-section {
  min-height: 100vh;   /* fallback */
  min-height: 100svh;  /* avoid iOS URL bar jump */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  perspective: 1000px;
  overflow: hidden;
  position: relative; /* anchor absolute children like CTA */
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.language-switcher {
  position: absolute;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  left: calc(2rem + env(safe-area-inset-left, 0px));
  z-index: 10;
}

.lang-switch-container {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.lang-option.bracket-link {
  color: #ffffff;
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  
  /* Override bracket link defaults for language switcher */
  padding: 0.3rem 0.15rem;
  --bracket-gap: 0.4em;
  --bracket-gap-hover: 0.7em;
}

.lang-option.bracket-link.active {
  opacity: 1;
}

.lang-option.bracket-link:hover {
  opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .language-switcher {
    bottom: 1.5rem;
    left: 1.5rem;
  }
  
  .lang-switch-container {
    gap: 1.5rem;
  }
  
  .lang-option.bracket-link {
    font-size: 0.8rem;
    --bracket-gap: 0.3em;
    --bracket-gap-hover: 0.6em;
  }
}

/* Text-only talk link (replaces old button) */
.talk-link-wrapper {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top, 0px));   /* respect notches */
  right: 1rem;   /* smaller offset on mobile */
  z-index: 2000; /* ensure above hero and sticky header */
  transform: translateZ(0); /* isolate from hero perspective */
  opacity: 0;                /* Hidden by default */
  pointer-events: none;      /* Not interactive when hidden */
  transition: opacity 0.35s cubic-bezier(.2,.7,.2,1);
}

/* Visible only in hero section */
.talk-link-wrapper.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.talk-link {
  position: relative;
  display: inline-block; /* width follows content */
  color: #fff;
  text-decoration: none;
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 200;
  /* Mobile-first: smaller label on small screens */
  font-size: clamp(0.95rem, 4.8vw, 1.1rem);
  letter-spacing: 0.02em;
  cursor: pointer;
  padding-bottom: 4px; /* tighter underline gap on mobile */
  padding-left: 0.3em; /* start text near the left end of the line */
  min-width: 6ch; /* allow a slightly narrower min width on mobile */
  min-height: 1.4em;
  isolation: isolate; /* prevent external 3D stacking artifacts over the link */
}

/* Scale up for larger screens */
@media (min-width: 768px) {
  .talk-link-wrapper { top: calc(2.2rem + env(safe-area-inset-top, 0px)); right: 2.2rem; }
  .talk-link {
    font-size: clamp(1.05rem, 2.4vw, 1.45rem);
    padding-bottom: 6px;
    min-width: 8ch;
  }
}

/* subtle animated underline */
.talk-link::after {
  content: "";
  position: absolute;
  left: 0.3em; /* align line start with text start */
  bottom: -4px;
  height: 1px;
  background: rgba(255,255,255,0.6);
  transform-origin: left center;
  /* Width follows active face via --uw-current; fallback covers full content width */
  width: var(--uw-current, calc(100% - 0.3em));
  transform: scaleX(0); /* hidden by default; length still computed via width */
  transition: width 0.25s ease, transform 0.45s cubic-bezier(.2,.7,.2,1), background-color 0.3s ease;
}
.talk-link:hover::after,
.talk-link:focus-visible::after { transform: scaleX(1); background: #fff; }

/* Switch which underline width var is active based on current face */
.talk-link[data-face="en"] { --uw-current: var(--uw-en); }
.talk-link[data-face="de"] { --uw-current: var(--uw-de); }
.talk-link[data-face="hu"] { --uw-current: var(--uw-hu); }

/* 3D roller */
.talk-roller {
  position: relative;
  display: inline-block;
  perspective: 1200px; /* deeper perspective for clearer rotation */
  /* Intrinsic size from sizer */
  width: max-content;
  height: auto;
  transform: translateZ(0); /* own 3D plane */
  /* Always allow minor glyph overhangs to render; prevents occasional clipping bars */
  overflow: visible;
  --depth: 12px; /* smaller default depth until JS measures */
}

/* Redundant safety: keep visible after 3D initializes */
.talk-roller.is-3d { overflow: visible; }

.roller-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  /* Rotate around the center of the cube, not behind it */
  transform-origin: 50% 50% 0;
  overflow: visible;
}

/* Hidden sizer dictates the roller's height/width */
.roller-sizer {
  position: static;
  visibility: hidden; /* contributes size without showing */
  white-space: nowrap;
  font: inherit;
  line-height: 1.05;
  /* Add a tiny right padding so punctuation (.) isn't clipped */
  padding: 2px 0.4ch 2px 0;
}

.talk-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* left-align the text within the face */
  backface-visibility: hidden;
  color: #fff;
  font-family: inherit;
  font-weight: 200;
  letter-spacing: 0.02em; /* ensure match with talk-link and measurer */
  white-space: nowrap;
  line-height: 1.05;
  /* Mirror sizer padding to avoid clipping the trailing period */
  padding: 2px 0.4ch 2px 0;
  overflow: visible;
}

/* Visible fallback label until 3D initializes */
.talk-fallback { color: #fff; font-family: inherit; font-weight: 200; white-space: nowrap; display: inline-block; text-align: left; }
.talk-roller.is-3d + .talk-fallback { display: none; }
.talk-roller:not(.is-3d) + .talk-fallback { display: inline; }
.talk-link { pointer-events: auto; }

.face-front { transform: translateZ(var(--depth)); }
.face-top { transform: rotateX(120deg) translateZ(var(--depth)); }
.face-back { transform: rotateX(240deg) translateZ(var(--depth)); }

/* Fallback: show front face in 2D until JS enables 3D */
.talk-roller:not(.is-3d) .roller-inner { position: static; transform: none !important; width: auto; height: auto; }
.talk-roller:not(.is-3d) .talk-face { position: static; transform: none !important; display: inline-block; height: auto; }
.talk-roller:not(.is-3d) .face-top,
.talk-roller:not(.is-3d) .face-back { display: none !important; }
.talk-roller:not(.is-3d) .face-right,
.talk-roller:not(.is-3d) .face-back,
.talk-roller:not(.is-3d) .face-left { display: none !important; }

/* Accessibility helper for hidden duplicate text */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

/* Hidden inline measurer to compute exact text widths for the underline */
.roller-measure {
  position: absolute;
  visibility: hidden;
  left: -9999px;
  top: -9999px;
  white-space: nowrap;
  font: inherit;
  letter-spacing: 0.02em; /* match .talk-link */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
  .talk-link-wrapper { top: 2.6rem; right: 3.6rem; }
  .talk-link { font-size: clamp(1.05rem, 2vw, 1.5rem); }
}

@media (min-width: 1200px) {
  .talk-link-wrapper { top: 3.1rem; right: 4.8rem; }
  .talk-link { font-size: 1.55rem; }
}

/* SVG sizing */
.hero-logo {
  width: min(80vw, 900px);
  height: auto;
  display: block;
}

/* Optional: per-path styling (non-empty to satisfy linters) */
.letter-path {
  vector-effect: non-scaling-stroke; /* keep stroke width consistent on scale */
  fill: none;
  stroke: white;
  stroke-width: 1.5px;
}

/* Cloned layers should be thinner to suggest depth */
.letter-clones .letter-path {
  stroke-width: 0.5px;
}

/* Wrapper enabling 3D and centering */
.svg-wrapper {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* SVG fills wrapper and stays block-level */
.monogram-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 800px;
  display: block;
}

/* Motto section styles */
.motto-section {
  background-color: #000000;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  /* Mobile-first: reduce left padding to bring text closer to the edge */
  padding: 0 10vw 0 6vw; /* top right bottom left */
}

.motto-section h1 {
  font-family: 'Major Mono Display', monospace;
  font-weight: 400; /* Major Mono Display only has normal weight */
  color: #ffffff;
  /* Mobile-first sizing; generous but safe */
  font-size: clamp(2.25rem, 10vw, 6.5rem);
  line-height: 1.1;
  margin: 0;
  text-transform: none; /* preserve original casing */
  font-variant: normal; /* ensure mixed case is visible */
}

/* Fixed-line wrappers for motto headline */
.motto-section h1 .line {
  display: block;           /* each forced line on its own row */
  white-space: nowrap;      /* prevent internal wrapping so counts are stable */
}

/* Ensure visible gap between words regardless of text nodes */
.motto-section h1 .word { display: inline-block; }
.motto-section h1 .word-spacer {
  display: inline-block;
  width: 0.5em; /* clearer gap between words */
}

/* Mobile specific tweak: smaller gap on the 3rd line ("mint egy") */
.motto-section h1 .motto-lines--mobile .line:nth-child(3) .word-spacer {
  width: 0.25em;
}

/* Mobile-first: show 5-line mobile version by default */
.motto-section h1 .motto-lines--mobile { display: block; }
.motto-section h1 .motto-lines--desktop { display: none; }

/* On desktop and larger screens, show the 2-line version */
@media (min-width: 768px) {
  .motto-section h1 .motto-lines--mobile { display: none; }
  .motto-section h1 .motto-lines--desktop { display: block; }
}

/* On larger desktops, slightly reduce scaling to avoid overflow */
@media (min-width: 992px) {
  .motto-section h1 {
    /* Allow more growth on standard desktops while staying two lines */
    font-size: clamp(2.25rem, 6vw, 9rem);
  }
  /* Give the text a bit more horizontal room on desktop so larger sizes still fit */
  .motto-section { padding: 0 6vw; }
}

@media (min-width: 1600px) {
  .motto-section h1 {
    /* On ultrawide, grow further with a higher cap */
    font-size: clamp(2.25rem, 5.2vw, 10rem);
  }
}

/* Partner section styles */
.partner-section {
  background-color: #000000;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10vw;
}

.partner-section .partner-headline {
  font-family: 'Major Mono Display', monospace;
  font-weight: 400; /* Major Mono Display only has normal weight */
  color: #ffffff;
  text-align: center;
  /* Keep to ~4/5 of screen width */
  width: 80vw;
  /* Always show full text – allow wrapping on smaller screens */
  /* ~70% of motto sizes on mobile */
  font-size: clamp(1.6rem, 7vw, 4.6rem);
  line-height: 1.05;
  margin: 0 auto;
  text-transform: none; /* preserve original casing */
  font-variant: normal; /* ensure mixed case is visible */
}
.sticky-header {
  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 1.25rem 6vw;
  background: transparent; /* transparent bar */
  mix-blend-mode: difference; /* invert text over bg */
  pointer-events: none; /* links will re-enable */
  opacity: 0; /* hidden until partner passed */
  transform: translateY(-10px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(.2,.7,.2,1);
  will-change: transform, opacity;
  text-align: center; /* center align content */
}
.sticky-header nav { pointer-events: auto; }
.sticky-header .post-header__nav {
  margin: 0 auto;
  padding: 0;
  display: flex;               /* center layout for sticky header */
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;           /* keep all items on one line */
  gap: clamp(1.5rem, 4vw, 6rem); /* responsive gap to avoid overflow */
  max-width: none;                /* let content define width; center with flex */
}
.sticky-header .post-header__item { flex: 0 0 auto; }
.sticky-header .bracket-link { color: #fff; font-weight: 200; white-space: nowrap; display: inline-flex; align-items: center; }
.sticky-header .bracket-link::before,
.sticky-header .bracket-link::after { color: inherit; }

/* On narrow viewports, allow wrapping to avoid overflow */
@media (max-width: 700px) {
  .sticky-header .post-header__nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem; /* tighter spacing when wrapping */
  }
  .sticky-header .bracket-link {
    white-space: normal; /* permit wrap on small screens */
  }
}

/* Reveal when body gets .after-partner (set via JS) */
body.after-partner .sticky-header {
  opacity: 1;
  transform: translateY(0);
}

/* Slight item rise with stagger for added liveliness */
@keyframes itemRise {
  0%   { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

body.after-partner .sticky-header .post-header__item {
  animation: itemRise 0.42s cubic-bezier(.2,.7,.2,1) both;
}
/* Symmetrical center-out: 2 & 3 first, then 1 & 4 */
body.after-partner .sticky-header .post-header__item:nth-child(2) { animation-delay: 0s; }
body.after-partner .sticky-header .post-header__item:nth-child(3) { animation-delay: 0s; }
body.after-partner .sticky-header .post-header__item:nth-child(1) { animation-delay: 0.12s; }
body.after-partner .sticky-header .post-header__item:nth-child(4) { animation-delay: 0.12s; }

.post-header {
  position: relative;
  z-index: 2;
  background: transparent;
  color: #fff;            /* base color; blending will invert over light bg */
  mix-blend-mode: difference; /* invert over background: white->black, black->white */
}

.post-header__nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2rem;
  justify-items: center;
  align-items: center;
  margin: 0 auto 3.5rem;
  padding: 0;
}

@media (min-width: 900px) {
  .post-header__nav {
    grid-template-columns: repeat(4, 1fr);
    gap: min(5vw, 10rem);
    max-width: 1100px;
  }
}

.post-header__item { list-style: none; }

.bracket-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: inherit; /* take color from .post-header (blended) */
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-weight: 200; /* Montserrat 200 as requested */
  letter-spacing: 0.3em; /* strong tracking like screenshots */
  text-transform: uppercase;
  font-size: clamp(0.8rem, 1.7vw, 1.05rem);
  padding: 0.45rem 0.2rem;
  line-height: 1; /* make 1em equal to glyph height to prevent clipping */
  --bracket-gap: 0.5em;              /* default bracket spacing */
  --bracket-gap-hover: 0.9em;        /* spacing when hovered */
  --slot-duration: 0.55s;              /* slot animation length */
  --slot-ease: cubic-bezier(.2,.7,.2,1);
  --slot-bleed: 0.32em;                /* extra headroom to prevent clipping */
  overflow: visible; /* ensure children showing beyond 1em are visible */
}
/* When JS enhancement splits into characters, use gap instead of letter-spacing */
:root.js .bracket-link { letter-spacing: 0; }

.bracket-link::before,
.bracket-link::after {
  content: '[';
  display: inline-block;
  color: inherit;
  margin: 0 var(--br-gap, var(--bracket-gap)); /* keep layout width constant */
  transition: transform 0.35s var(--slot-ease); /* animate visually without pushing layout */
}
.bracket-link::after { content: ']'; }
/* Visual bracket offsets via transforms (no layout shift) */
.bracket-link::before { transform: translateX(calc(-1 * var(--br-off-l, 0em))); }
.bracket-link::after  { transform: translateX(var(--br-off-r, 0em)); }

/* Brackets ease outward slightly on hover/focus */
:root:not(.js) .bracket-link:hover::before,
:root:not(.js) .bracket-link:focus-visible::before,
:root:not(.js) .bracket-link:hover::after,
:root:not(.js) .bracket-link:focus-visible::after {
  margin: 0 var(--bracket-gap-hover);
}

/* Slot-machine text structure */
.bracket-label {
  display: inline-block;
  height: 1em;            /* visible letter area equals text line */
  overflow: visible;      /* allow chars to extend slightly */
  vertical-align: baseline;
  transform-style: preserve-3d;
  perspective: 600px;     /* subtle 3D slot feel */
  will-change: transform;
}
.bracket-track { display: block; will-change: transform, filter; transform-origin: center center; }
.label-line { display: block; line-height: 1em; }

/* Per-character variant (preferred) */
.bracket-label { display: inline-flex; gap: var(--char-gap, 0.3em); }
.bracket-char { display: inline-block; height: calc(1em + var(--slot-bleed) * 2); overflow: hidden; transform: translateY(calc(-1 * var(--slot-bleed))); }
.bracket-char-track { display: block; will-change: transform; transform-origin: center center; transform: translateZ(0); backface-visibility: hidden; }
.bracket-char-line { display: block; line-height: calc(1em + var(--slot-bleed) * 2); height: calc(1em + var(--slot-bleed) * 2); color: inherit; }

/* On hover/focus, roll once */
:root:not(.js) .bracket-link:hover .bracket-track,
:root:not(.js) .bracket-link:focus-visible .bracket-track {
  animation: slotOnce var(--slot-duration) var(--slot-ease) both;
}

@keyframes slotOnce {
  0%   { transform: translateY(0%) rotateX(0deg); }
  55%  { transform: translateY(-85%) rotateX(-10deg); }
  100% { transform: translateY(-50%) rotateX(0deg); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bracket-link:hover .bracket-track,
  .bracket-link:focus-visible .bracket-track { animation: none !important; transform: none !important; }
}

/* content section removed */

/* Partner headline line/spacer styles (reuse motto rules) */
.partner-section .partner-headline .line {
  display: block;
  white-space: nowrap;
}
.partner-section .partner-headline .word { display: inline-block; }
.partner-section .partner-headline .word-spacer { display: inline-block; width: 0.5em; }

/* Variant visibility: mobile shows 4-line version, desktop shows 2-line version */
.partner-section .partner-headline .partner-lines--mobile { display: block; }
.partner-section .partner-headline .partner-lines--desktop { display: none; }

/* Enhanced mobile typography for premium look */
.partner-section .partner-headline .partner-lines--mobile .line {
  margin-bottom: 0.15em; /* tighter line spacing for rhythm */
}

.partner-section .partner-headline .partner-lines--mobile .line:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .partner-section .partner-headline .partner-lines--mobile { display: none; }
  .partner-section .partner-headline .partner-lines--desktop { display: block; }
}

/* Partner headline: desktop scaling similar to motto */
@media (min-width: 992px) {
  .partner-section { padding: 0 6vw; }
  .partner-section .partner-headline {
    /* ~70% of motto desktop scaling */
    font-size: clamp(1.6rem, 4.2vw, 6.3rem);
  }
}

@media (min-width: 1600px) {
  .partner-section .partner-headline {
    /* ~70% of motto ultrawide scaling */
    font-size: clamp(1.6rem, 3.6vw, 7rem);
  }
}

/* Full-screen test sections for sticky header validation */
.test-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.test-section--black { background: #000; color: #fff; }
/* white test section removed */
.test-section .test-inner {
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-weight: 200;
  font-size: clamp(1rem, 3vw, 2rem);
  opacity: 0.8;
}

/* ========================================
   AI CHAT SECTION
   ======================================== */

.chat-section {
  background-color: #000000;
  color: #ffffff;
  min-height: 100vh;
  padding: 4rem 0 8rem 0;
  position: relative;
  overflow: hidden;
}

.chat-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  position: relative;
}

.chat-header {
  text-align: center;
  margin-bottom: 4rem;
}

.chat-title {
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #ffffff;
  margin: 0 0 1rem 0;
  line-height: 1.1;
}

.chat-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.4;
}

.chat-interface {
  position: relative;
  height: 70vh;   /* fallback */
  height: 70svh;  /* more stable on mobile */
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0 1rem 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 1.5rem;
  scroll-behavior: smooth;
  position: relative;
  
  /* Neumorphic inner shadow effect */
  background: #000000;
  border-radius: 0;
  box-shadow: 
    inset 8px 8px 16px rgba(0, 0, 0, 0.3),
    inset -8px -8px 16px rgba(255, 255, 255, 0.02);
  
  /* Fade-out gradient masks - top fade for messages going up */
  mask: 
    linear-gradient(to bottom, 
      transparent 0%,
      rgba(0, 0, 0, 0.2) 8%,
      rgba(0, 0, 0, 0.8) 15%,
      black 22%,
      black 100%
    );
  -webkit-mask: 
    linear-gradient(to bottom, 
      transparent 0%,
      rgba(0, 0, 0, 0.2) 8%,
      rgba(0, 0, 0, 0.8) 15%,
      black 22%,
      black 100%
    );
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-messages {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.message {
  display: flex;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
  animation: messageSlideIn 0.4s ease-out forwards;
  padding: 0 1rem;
}

.message.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Major Mono Display', monospace;
}

.bot-message .message-avatar {
  background: #ffffff;
  color: #000000;
  box-shadow: 
    4px 4px 8px rgba(0, 0, 0, 0.3),
    -2px -2px 6px rgba(255, 255, 255, 0.1);
}

.user-message .message-avatar {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    inset 2px 2px 4px rgba(0, 0, 0, 0.5),
    inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.user-message .avatar-icon::after {
  content: "YOU";
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  font-weight: 600;
}

.message-content {
  flex: 1;
  max-width: 75%;
}

.message-bubble {
  border-radius: 18px;
  padding: 1rem 1.25rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  line-height: 1.5;
  font-size: 0.95rem;
  position: relative;
}

.bot-message .message-bubble {
  background: #ffffff;
  color: #000000;
  box-shadow: 
    6px 6px 12px rgba(0, 0, 0, 0.3),
    -3px -3px 8px rgba(255, 255, 255, 0.1);
}

.user-message .message-bubble {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.5),
    inset -3px -3px 6px rgba(255, 255, 255, 0.1),
    4px 4px 8px rgba(0, 0, 0, 0.2);
}

.message-bubble p {
  margin: 0;
}

.message-bubble p + p {
  margin-top: 0.75rem;
}

.chat-input-container {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 0 0 0;
  background: linear-gradient(
    to top,
    #000000 60%,
    rgba(0, 0, 0, 0.9) 80%,
    rgba(0, 0, 0, 0.5) 90%,
    transparent 100%
  );
  backdrop-filter: blur(10px);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 0.875rem 1.25rem;
  transition: all 0.3s ease;
  
  /* Neumorphic styling */
  box-shadow: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.05),
    8px 8px 16px rgba(0, 0, 0, 0.3);
}

.chat-input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.6),
    inset -4px -4px 8px rgba(255, 255, 255, 0.08),
    8px 8px 20px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(255, 255, 255, 0.1);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  width: 60px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  font-family: 'Major Mono Display', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  position: relative;
  overflow: hidden;
}

.chat-send-btn .bracket-link-text,
.chat-send-btn .bracket-label {
  font-family: 'Major Mono Display', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  color: inherit;
}

.chat-send-btn:hover:not(:disabled) {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.chat-send-btn:hover:not(:disabled) .bracket-link-text,
.chat-send-btn:hover:not(:disabled) .bracket-label {
  color: #000000;
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-send-btn:not(:disabled) {
  color: #ffffff;
  border-color: #ffffff;
}

.chat-status {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  text-align: center;
  min-height: 1rem;
}

/* Typing indicator */
.typing-indicator {
  padding: 0 1rem;
}

.typing-bubble {
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 
    6px 6px 12px rgba(0, 0, 0, 0.3),
    -3px -3px 8px rgba(255, 255, 255, 0.1) !important;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes messageSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .chat-container {
    padding: 0 1rem;
  }
  
  .chat-interface {
    height: 60vh;   /* fallback */
    height: 60svh;  /* avoid address bar impact */
    min-height: 400px;
    /* Push the conversation area a bit lower like on the "2.png" mock */
    margin-top: 4svh;
  }
  
  .chat-messages {
    padding: 1.5rem 0;
    gap: 1rem;
  }
  
  .chat-header {
    /* Give the title/subtitle more breathing space above the chat */
    margin-bottom: 3.25rem;
  }

  .chat-input-container {
    padding: 1.5rem 0 calc(env(safe-area-inset-bottom, 0px)) 0;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .chat-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
  
  .message-bubble {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
}

/* Ultra-small phones: tighten spacing a bit further */
@media (max-width: 360px) {
  .lang-switch-container { gap: 1rem; }
  .lang-option.bracket-link { font-size: 0.72rem; }
  .talk-link { font-size: clamp(0.9rem, 5.2vw, 1rem); }
  .sticky-header .post-header__nav { gap: 0.6rem 1rem; }
}

@media (max-width: 480px) {
  .chat-section {
    padding: 2rem 0 6rem 0;
  }
  
  .chat-header {
    /* Match the desired separation from the mock */
    margin-bottom: 3.75rem;
  }
  
  .chat-interface {
    height: 55vh;
    min-height: 350px;
    margin-top: 6vh;
  }
  
  .message-content {
    max-width: 90%;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .message {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .typing-dots span {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .chat-input-wrapper {
    border-color: #ffffff;
  }
  
  .message-bubble {
    border-color: #ffffff;
  }
}

/* ========================================
   MOBILE MENU SYSTEM
   ======================================== */

/* Mobile Header Bar */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 1.5rem;
  padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
  display: none; /* Hidden on desktop */
  background: transparent;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(.2,.7,.2,1);
  will-change: transform, opacity;
}

.mobile-header.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-header__inner {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  max-width: 100%;
  pointer-events: auto;
}

.mobile-logo {
  text-decoration: none;
  color: #ffffff;
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.mobile-logo:hover {
  opacity: 1;
}

.mobile-logo__text {
  display: block;
}

/* Menu Toggle Button */
.menu-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  color: #ffffff;
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.2em;
  transition: opacity 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.menu-toggle:hover {
  opacity: 0.8;
}

.menu-toggle:active {
  transform: scale(0.95);
}

.menu-toggle__text {
  display: block;
  line-height: 1;
}

.menu-toggle__icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 36px;
}

.menu-toggle__line {
  width: 100%;
  height: 1.5px;
  background: #ffffff;
  display: block;
  transform-origin: right center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle.is-active .menu-toggle__line:first-child {
  transform: rotate(-45deg) translateY(2px);
}

.menu-toggle.is-active .menu-toggle__line:last-child {
  transform: rotate(45deg) translateY(-2px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: #f5f5f5;
  color: #000000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Subtle noise texture for depth */
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.015) 2px,
      rgba(0, 0, 0, 0.015) 4px
    );
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-overlay__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  min-height: 100svh;
}

/* Close Button */
.menu-close {
  position: relative;
  z-index: 10;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  align-self: flex-end;
  color: #000000;
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  margin-bottom: 2rem;
  margin-right: -1rem;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-close:hover {
  opacity: 0.6;
}

.menu-close:active {
  transform: scale(0.98);
}

.menu-close__text {
  display: block;
  pointer-events: none;
}

/* Location & Time Info */
.mobile-menu__info {
  margin-bottom: 3rem;
  opacity: 0;
}

.mobile-menu__weather {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: 0.7rem;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #000000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.weather-icon {
  font-weight: 600;
  font-size: 0.7rem;
  display: inline-block;
  line-height: 1;
  letter-spacing: 0.1em;
}

.weather-temp {
  font-weight: 600;
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.weather-condition {
  display: inline-block;
  opacity: 0.6;
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
}

.mobile-menu__status-wrapper {
  margin-top: 0.5rem;
}

.status-heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.5rem;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000000;
  margin: 0 0 0.35rem 0;
  opacity: 0.4;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-bracket {
  font-family: 'Major Mono Display', monospace;
  font-size: 0.6rem;
  opacity: 0.5;
}

.status-heading-text {
  display: inline-block;
}

.mobile-menu__status {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.65rem;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #000000;
  margin: 0;
  opacity: 0.7;
}

.status-dots {
  display: inline-block;
  margin-left: 0.3em;
  letter-spacing: 0.25em;
  font-size: 1.4em;
}

.status-dots span {
  display: inline-block;
  animation: statusDotBlink 1.5s ease-in-out infinite;
  will-change: opacity;
}

.status-dots span:nth-child(1) {
  animation-delay: 0s;
}

.status-dots span:nth-child(2) {
  animation-delay: 0.3s;
}

.status-dots span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes statusDotBlink {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dots span {
    animation: none;
    opacity: 0.7;
  }
}

/* Main Navigation */
.mobile-menu__nav {
  flex: 1;
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
}

.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.mobile-menu__item {
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(30px);
}

.mobile-menu__link {
  text-decoration: none;
  color: #000000;
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: block;
  position: relative;
  padding: 0.25rem 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
}

.mobile-menu__link:hover,
.mobile-menu__link:focus {
  transform: translateX(10px);
}

.mobile-menu__link::before {
  content: attr(data-index);
  position: absolute;
  left: -2.5rem;
  top: 0.25rem;
  font-family: 'Major Mono Display', monospace;
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.mobile-menu__link-text {
  display: block;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.menu-link-char {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Add subtle shadow effect to menu items on hover */
.mobile-menu__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background: #000000;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu__link:hover::after,
.mobile-menu__link:focus::after {
  width: 100%;
}

/* Footer Section */
.mobile-menu__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Contact Information */
.mobile-menu__contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
}

.mobile-menu__contact-link {
  text-decoration: none;
  color: #000000;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 5.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: inline-block;
  width: fit-content;
  position: relative;
}

.mobile-menu__contact-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #000000;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu__contact-link:hover {
  opacity: 0.7;
  transform: translateX(5px);
}

.mobile-menu__contact-link:hover::after {
  width: 100%;
}

/* Social Links */
.mobile-menu__socials {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
}

.mobile-menu__social-link {
  text-decoration: none;
  color: #000000;
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: inline-block;
  width: fit-content;
  transform-origin: left center;
}

.mobile-menu__social-link:hover {
  opacity: 0.6;
  transform: translateX(3px) scale(1.02);
}

/* Show mobile menu on small screens */
@media (max-width: 768px) {
  .mobile-header {
    display: block;
  }
  
  /* Hide desktop sticky header on mobile */
  .sticky-header {
    display: none !important;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100vh;
  height: 100svh;
  left: 0;
  right: 0;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .menu-toggle__line,
  .mobile-menu__link,
  .mobile-menu__contact-link,
  .mobile-menu__social-link,
  .mobile-menu__bottom-link {
    transition: none !important;
  }
  
  .mobile-menu__item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Focus states for accessibility */
.menu-toggle:focus-visible,
.menu-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.mobile-menu__link:focus-visible,
.mobile-menu__contact-link:focus-visible,
.mobile-menu__social-link:focus-visible,
.mobile-menu__bottom-link:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 4px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000000;
  color: #ffffff;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* Fine-tune for very small devices */
@media (max-width: 360px) {
  .mobile-header {
    padding: 1.25rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  }
  
  .mobile-logo {
    font-size: 0.6rem;
  }
  
  .menu-toggle {
    font-size: 0.65rem;
  }
  
  .menu-toggle__icon {
    width: 24px;
  }
  
  .mobile-menu__link::before {
    left: -2rem;
    font-size: 0.55rem;
  }
}

