/* Layout and motion refinements. */
.ambient-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-art::before,
.ambient-art::after {
  content: "";
  position: absolute;
  width: 390px;
  height: 320px;
  background: url("data:image/svg+xml,%3Csvg width='390' height='320' viewBox='0 0 390 320' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M38 212C112 198 242 168 259 91C274 24 148 13 109 76C66 144 151 239 228 260' stroke='%23C7D1C9' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M202 228L231 265L185 272' stroke='%23C7D1C9' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .105;
  filter: blur(.1px);
}

.ambient-art::before { top: 17vh; right: -58px; transform: rotate(-14deg); }
.ambient-art::after { bottom: 7vh; left: -105px; transform: rotate(164deg) scale(.82); opacity: .07; }

.ambient-loop,
.ambient-shape,
.ambient-ring,
.ambient-grid { position: absolute; display: block; pointer-events: none; }

.ambient-loop {
  width: 300px;
  height: 240px;
  background: url("data:image/svg+xml,%3Csvg width='300' height='240' viewBox='0 0 300 240' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 158C72 150 199 130 224 65C244 12 120 17 86 75C50 136 115 204 184 205' stroke='%23AFC3B3' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M162 177L188 207L153 216' stroke='%23AFC3B3' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .075;
}
.loop-a { left: 17vw; top: 72vh; transform: rotate(72deg) skewX(-12deg); }
.loop-b { right: 20vw; top: 127vh; transform: rotate(-120deg) scale(.7, 1.18); opacity: .06; }
.loop-c { left: 3vw; top: 196vh; transform: rotate(13deg) scale(1.12, .7); opacity: .06; }

.ambient-shape { width: 64px; height: 64px; border: 1px solid #a7c3aa; opacity: .11; }
.diamond-a { left: 44vw; top: 44vh; transform: rotate(45deg); animation: ambientFloat 11s ease-in-out infinite; }
.diamond-b { right: 13vw; top: 214vh; width: 118px; height: 118px; transform: rotate(19deg); opacity: .06; }
.triangle-a { left: 12vw; top: 143vh; width: 0; height: 0; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 58px solid #bfcebd; opacity: .075; transform: rotate(14deg); }

.ambient-ring { width: 235px; height: 235px; border: 1px solid #a7c3aa; border-radius: 50%; opacity: .065; }
.ring-a { left: -110px; top: 113vh; }
.ring-b { right: 7vw; top: 180vh; width: 118px; height: 118px; border-style: dashed; opacity: .08; animation: slowSpin 30s linear infinite; }

.ambient-grid { right: 5vw; top: 78vh; width: 170px; height: 170px; opacity: .045; background-image: linear-gradient(#b9c9ba 1px, transparent 1px), linear-gradient(90deg, #b9c9ba 1px, transparent 1px); background-size: 28px 28px; transform: rotate(12deg); }

.header, #app, .footer { position: relative; z-index: 1; }

.header { min-height: 98px; padding-inline: 5.5vw; }

.brand { font-size: 28px; letter-spacing: -2px; }
.brand small { margin-top: 10px; letter-spacing: 4.4px; }

.nav { gap: 42px; }
.nav a { font-size: 16px; letter-spacing: .8px; }

.header-socials {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 17px;
  transform: translate(-50%, -50%);
}

.header-socials a {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color .25s ease, border-color .25s ease, transform .25s ease;
}

.header-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.header-socials svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.hero { min-height: 740px; padding-top: 11vh; }
.hero-copy {
  width: min(560px, 47vw);
  max-width: none;
  margin: auto 0 2vw;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.42;
  color: #c4cbc5;
}

.orb { right: -5vw; top: 10vw; }

.stats { grid-auto-rows: 1fr; }
.stat,
.stat:last-child {
  min-height: 175px;
  padding: 31px 26px 27px;
  border-right: 0;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat b { line-height: 1; margin-bottom: 16px; }
.stat span { display: block; line-height: 1.45; }

#app {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,.75,.25,1);
}

#app.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .header-socials { display: none; }
}

@media (max-width: 720px) {
  .ambient-art::before { width: 260px; height: 230px; right: -92px; top: 28vh; opacity: .07; }
  .ambient-art::after { display: none; }
  .header { min-height: 78px; }
  .brand { font-size: 24px; }
  .nav { gap: 22px; }
  .nav a { font-size: 15px; }
  .hero { min-height: 660px; }
  .hero-copy { width: 100%; margin-bottom: 0; font-size: clamp(21px, 6vw, 27px); }
  .orb { right: -45vw; top: 28vw; }
  .stat, .stat:last-child { min-height: 140px; padding: 26px 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #app, .header-socials a { transition: none; }
}

/* Original geometric artwork for the Journal cards. */
.journal-head { position: relative; overflow: hidden; }
.journal-head::after {
  content: "";
  position: absolute;
  width: 132px;
  height: 132px;
  right: 9vw;
  bottom: -55px;
  border: 1px solid var(--accent);
  transform: rotate(30deg);
  opacity: .55;
}

.post-card { min-height: 390px; overflow: hidden; }
.post-art {
  position: relative;
  height: 145px;
  margin: -25px -25px 25px;
  overflow: hidden;
  background: #17231d;
  border-bottom: 1px solid var(--line);
}

.post-art-tag {
  position: absolute;
  z-index: 2;
  left: 25px;
  bottom: 16px;
  color: var(--accent);
  padding: 7px 9px;
  background: rgba(16, 20, 18, .78);
  font: 600 18px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .8);
}
.post-art::before,
.post-art::after,
.post-art i,
.post-art b,
.post-art em { content: ""; position: absolute; display: block; }

.art-0::before { width: 170px; height: 170px; right: -18px; top: -65px; border-radius: 50%; background: var(--accent); opacity: .9; }
.art-0::after { width: 150px; height: 150px; left: 24px; bottom: -113px; border: 1px solid #69936d; transform: rotate(45deg); }
.art-0 i { width: 11px; height: 11px; left: 54%; top: 58%; background: var(--coral); transform: rotate(45deg); }

.art-1::before { width: 215px; height: 215px; left: -46px; top: -94px; border: 1px solid #7fbe82; border-radius: 50%; }
.art-1::after { width: 0; height: 0; right: 36px; bottom: -1px; border-left: 70px solid transparent; border-right: 70px solid transparent; border-bottom: 125px solid var(--accent); opacity: .88; }
.art-1 i { width: 68px; height: 68px; right: 107px; top: 20px; border: 1px solid #e9ede9; transform: rotate(22deg); }

.art-2::before { width: 92px; height: 92px; left: 38px; top: 23px; background: var(--accent); transform: rotate(45deg); }
.art-2::after { width: 240px; height: 1px; right: -18px; top: 76px; background: #7ba27e; transform: rotate(-25deg); }
.art-2 i { width: 150px; height: 150px; right: -70px; top: -68px; border: 1px solid #e9ede9; border-radius: 50%; }
.art-2 b { width: 9px; height: 9px; background: var(--coral); left: 164px; bottom: 28px; }

/* Keep decorative shapes deliberately quiet so category labels remain legible. */
.post-art::before,
.post-art::after,
.post-art i,
.post-art b,
.post-art em { opacity: .38; }

.post-card:hover .post-art::before { transform: scale(1.08) rotate(12deg); }
.post-card:hover .post-art::after { transform: rotate(48deg) translate(6px, -5px); }
.post-card:hover .art-1::after { transform: translateY(-8px); }
.post-card:hover .art-2::after { transform: rotate(-25deg) translateX(-14px); }
.post-art::before, .post-art::after, .post-art i, .post-art b { transition: transform .7s cubic-bezier(.2,.75,.25,1); }

.hero::before {
  content: "";
  position: absolute;
  width: 50px;
  height: 50px;
  left: 48%;
  bottom: 14%;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  opacity: .65;
  animation: drift 7s ease-in-out infinite;
}
.hero::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  left: 61%;
  bottom: 19%;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 28px solid var(--coral);
  animation: drift 5.5s ease-in-out infinite reverse;
}

.stat { transition: background .3s ease, transform .3s ease; }
.stat:hover { background: rgba(211,255,89,.06); transform: translateY(-4px); }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-13px) rotate(56deg); }
}

@keyframes ambientFloat {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(53deg) translateY(-18px); }
}

@keyframes slowSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .loop-a { left: -85px; top: 95vh; opacity: .045; }
  .loop-b, .loop-c, .diamond-b, .triangle-a, .ring-b, .ambient-grid { display: none; }
  .diamond-a { left: auto; right: 10vw; top: 72vh; opacity: .06; }
  .ring-a { top: 148vh; opacity: .045; }
  .post-card { min-height: 350px; }
  .journal-head::after { right: 4vw; }
  .hero::before, .hero::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .diamond-a, .ring-b { animation: none; }
}

/* Phone layout: keep navigation and content in their own predictable layers. */
.ticker {
  padding: 0;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 22s linear infinite;
  will-change: transform;
}

.ticker-track span {
  display: block;
  flex: none;
  padding: 20px 34px;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 27px);
  letter-spacing: .08em;
}

.ticker-track strong { margin: 0 34px; }

@keyframes ticker-scroll {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

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

@media (max-width: 720px) {
  body { overflow-x: hidden; }

  .header {
    height: 76px;
    min-height: 76px;
    padding-inline: 20px;
    /* Keep the fixed menu above #app, which has its own stacking layer. */
    z-index: 40;
  }

  .brand { font-size: 23px; }
  .brand small { font-size: 9px; margin-top: 8px; letter-spacing: 3.4px; }

  .menu-toggle {
    position: relative;
    z-index: 12;
    display: block;
    padding: 6px;
  }

  .nav,
  .nav.open {
    position: fixed;
    z-index: 11;
    top: 76px;
    right: 0;
    left: 0;
    display: flex;
    gap: 4px;
    padding: 24px 20px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 35px rgba(0,0,0,.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a { width: 100%; padding: 14px 0; font-size: 16px; }

  /* While the menu is open the page must not receive touches behind it. */
  body.menu-open { overflow: hidden; }

  h1 { font-size: clamp(43px, 13.5vw, 61px); line-height: .93; }
  .page-head h1, .article h1, .legal h1 { font-size: clamp(42px, 12.6vw, 58px); }
  .page-head { padding: 75px 20px 58px; }
  .section { padding: 65px 20px; }
  .article, .legal { padding-inline: 20px; }

  .hero {
    min-height: 630px;
    padding: 68px 20px 46px;
  }
  .hero-copy { position: relative; z-index: 2; width: 100%; max-width: 100%; font-size: clamp(21px, 6.4vw, 28px); }
  .orb { width: 118vw; height: 118vw; right: -60vw; top: 23vw; opacity: .58; }

  .section-title { gap: 24px; margin-bottom: 38px; }
  .section-title p { max-width: 100%; font-size: 16px; }
  .stats { display: block; }
  .stat, .stat:last-child { min-height: auto; padding: 25px 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }

  .service { grid-template-columns: 34px 1fr 24px; gap: 12px; }
  .service h3 { font-size: 20px; }
  .advantages { grid-template-columns: 1fr; }
  .advantage, .advantage:nth-child(even) { padding: 26px 0 34px; border-left: 0; }

  .post-card { min-height: 345px; }
  .post-card h2 { font-size: 24px; }
  .post-art { height: 132px; }

  .career-grid, .contact-grid { gap: 40px; }
  .job { align-items: flex-start; padding: 22px 0; }
  .job a { padding-top: 3px; }

  .footer { padding: 46px 20px 24px; }
  .footer-bottom { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .socials, .footer-links { flex-wrap: wrap; gap: 14px; }
}
