/* ==========================================================================
   Navigation panel (opened by the grid button in the top bar)
   Minimal style in the index.html language: salt background, hairlines, black type,
   red only as the accent (the 56×4 red bar, numbers, hover, current page).
   Markup: <nav class="navpanel"> in the page.  Behaviour + GSAP: js/nav.js
   ========================================================================== */
.navpanel { --line: var(--hairline);
  position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; padding-top: calc(var(--safe-t) + 92px);
  background: var(--white); visibility: hidden; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
body.is-menu-open { overflow: hidden; }
body.is-menu-open .topbar { position: fixed; z-index: 45; }

/* Columns ---------------------------------------------------------------- */
/* Grey columns on the white panel. The column holding the current page turns white.
   Section tile: white, cut bottom-left corner. Current section: filled red. Hover: red outline drawn round the tile. */
.navpanel__cols { flex: 1 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1vw, 16px); min-height: 480px; margin: 0 var(--pad) 30px; list-style: none; }
.navcol { position: relative; padding: clamp(12px, 1vw, 16px) clamp(12px, 1vw, 16px) 48px; background: var(--salt); transition: background-color .4s var(--ease); }
.navcol:hover, .navcol:has(:focus-visible), .navcol.is-current { background: var(--white); }
/* Brand "sea" pattern strip along the bottom of the column (same artwork as the 3D line, js/scene/patterns.js).
   Shown for the hovered and the current column; on hover it runs in a seamless loop. */
.navcol::after { --tile: 158.45px; /* one SVG repeat at 14px high: 579.37 × 14 / 51.19 */
  content: ''; position: absolute; left: clamp(12px, 1vw, 16px); right: clamp(12px, 1vw, 16px); bottom: 12px; height: 14px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 579.37 51.19' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23EA0029'%3E%3Cpath d='M17.84 0H0V17.84H17.84V0Z'/%3E%3Cpath d='M42.42 33.11L45.64 28.49C51.6 19.8 54.66 17.84 62.06 17.84H90.26V0H72.42H60.61C44.35 0 40.01 5.23 31.32 17.84L28.1 22.46C21.82 31.57 18.76 33.34 11.03 33.34H0V51.18H12.48C29.38 51.18 33.24 46 42.41 33.11'/%3E%3Cpath d='M72.4499 33.35H54.6099V51.19H84.8999C101.81 51.19 105.66 46.01 114.83 33.12L118.05 28.5C124.01 19.81 127.07 17.85 134.47 17.85H162.67V0H144.83H133.02C116.77 0 112.43 5.23 103.74 17.84L100.52 22.46C94.2399 31.57 91.1799 33.34 83.4599 33.34H72.4599L72.4499 33.35Z'/%3E%3Cpath d='M144.87 33.35H127.03V51.19H157.32C174.22 51.19 178.08 46.01 187.25 33.12L190.47 28.5C196.43 19.81 199.49 17.85 206.89 17.85H235.09V0H217.25H205.44C189.18 0 184.85 5.23 176.16 17.84L172.94 22.46C166.66 31.57 163.6 33.34 155.87 33.34H144.87V33.35Z'/%3E%3Cpath d='M217.28 33.35H199.44V51.19H229.73C246.63 51.19 250.49 46.01 259.66 33.12L262.88 28.5C268.83 19.81 271.89 17.85 279.3 17.85H307.5V0H289.66H277.85C261.6 0 257.27 5.23 248.57 17.84L245.35 22.46C239.07 31.57 236.01 33.34 228.28 33.34H217.28V33.35Z'/%3E%3Cpath d='M289.7 33.35H271.86V51.19H302.15C319.05 51.19 322.91 46.01 332.08 33.12L335.3 28.5C341.26 19.81 344.31 17.85 351.72 17.85H379.92V0H362.08H350.27C334.01 0 329.67 5.23 320.98 17.84L317.76 22.46C311.48 31.57 308.42 33.34 300.69 33.34H289.69L289.7 33.35Z'/%3E%3Cpath d='M362.12 33.35H344.28V51.19H374.57C391.47 51.19 395.33 46.01 404.5 33.12L407.72 28.5C413.68 19.81 416.73 17.85 424.14 17.85H452.34V0H434.5H422.69C406.43 0 402.1 5.23 393.4 17.84L390.18 22.46C383.9 31.57 380.84 33.34 373.11 33.34H362.11L362.12 33.35Z'/%3E%3Cpath d='M434.54 33.35H416.7V51.19H446.99C463.89 51.19 467.75 46.01 476.92 33.12L480.14 28.5C486.1 19.81 489.15 17.85 496.56 17.85H524.76V0H506.92H495.11C478.85 0 474.52 5.23 465.82 17.84L462.6 22.46C456.32 31.57 453.26 33.34 445.53 33.34H434.53L434.54 33.35Z'/%3E%3Cpath d='M579.38 33.3501H561.54V51.1901H579.38V33.3501Z'/%3E%3Cpath d='M506.95 33.35H489.11V51.19H519.4C536.3 51.19 540.16 46.01 549.33 33.12L552.55 28.5C558.51 19.81 561.56 17.85 568.97 17.85H579.36V0H567.52C551.26 0 546.93 5.23 538.23 17.84L535.01 22.46C528.73 31.57 525.67 33.34 517.94 33.34H506.94L506.95 33.35Z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / var(--tile) 14px repeat-x;
  opacity: 0; transition: opacity .35s var(--ease);
  animation: navcol-pattern 2.4s linear infinite paused; }
.navcol:hover::after, .navcol:has(:focus-visible)::after, .navcol.is-current::after { opacity: 1; }
.navcol:hover::after, .navcol:has(:focus-visible)::after { animation-play-state: running; }
@keyframes navcol-pattern { from { background-position-x: 0; } to { background-position-x: -158.45px; } } /* = one --tile */
@media (prefers-reduced-motion: reduce) { .navcol::after { animation: none; } }

.navcard { --cut: 16px; position: relative; display: flex; flex-direction: column; justify-content: space-between; height: clamp(88px, 6.4vw, 104px); padding: 14px 14px 12px;
  color: var(--red); text-decoration: none; background: var(--white); isolation: isolate;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: color .35s var(--ease); }
.navcard::before { /* red fill, revealed as a growing circle from the cut corner */
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--red);
  clip-path: circle(0% at 0 100%); transition: clip-path .6s var(--ease); }
.navcard b { position: relative; font-size: clamp(15px, 1.1vw, 18px); font-weight: 700; line-height: 1.18; letter-spacing: -.01em; }
.navcard__foot { display: flex; justify-content: flex-end; }
.navcard__num { display: none; }
.navcard__arrow { position: relative; width: 18px; height: 18px; overflow: hidden; transition: transform .45s var(--ease); }
.navcol:hover .navcard__arrow, .navcard:focus-visible .navcard__arrow { transform: rotate(45deg); } /* ↘ turns to ↓ on hover */
.navcard__arrow svg { position: absolute; inset: 0; width: 18px; height: 18px; }
.navcard__arrow svg + svg { transform: translate(-130%, -130%); }
.navcard__line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.navcard__line path { fill: none; stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 100 100; stroke-dashoffset: 100; transition: stroke-dashoffset .8s var(--ease); }

/* Current section's tile: filled red. Other tiles on hover: a red outline draws itself round the cut-corner shape */
.navcol.is-current .navcard { color: var(--white); }
.navcol.is-current .navcard::before { clip-path: circle(150% at 0 100%); }
.navcol:not(.is-current):hover .navcard__line path, .navcol:not(.is-current) .navcard:focus-visible .navcard__line path { stroke-dashoffset: 0; }
.navcol:hover .navcard__arrow svg, .navcard:focus-visible .navcard__arrow svg { animation: navcard-launch .9s var(--ease) infinite; }
.navcard:focus-visible { outline: none; }
/* two stacked arrows: one leaves bottom-right as the next arrives from top-left — a seamless loop */
@keyframes navcard-launch { from { translate: 0 0; } to { translate: 130% 130%; } }
@media (prefers-reduced-motion: reduce) { .navcol:hover .navcard__arrow svg { animation: none; } }

.navlinks { margin-top: 24px; padding: 0 10px; list-style: none; }
.navlinks li + li { margin-top: 6px; }
.navlinks a { display: inline-block; font-size: 14px; line-height: 1.3; color: #333; text-decoration: none; transition: color .2s, transform .3s var(--ease); }
.navlinks a:hover, .navlinks a:focus-visible { color: var(--red); outline: none; transform: translateX(3px); }
.navlinks a[aria-current] { color: var(--red); }
.navlinks .sub { padding-left: 11px; }
.navlinks .sub a { font-weight: 300; color: rgba(51, 51, 51, .75); }
.navlinks .sub a:hover { color: var(--red); }
/* Bottom bar ------------------------------------------------------------- */
.navpanel__foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 var(--pad); padding: 22px 0 calc(var(--safe-b) + 22px); border-top: 1px solid var(--red); }
.navsocial { display: flex; gap: 8px; list-style: none; }
/* Filled grey circles with white icons; red on hover */
.navsocial a, .navtwin i { display: grid; place-items: center; width: 46px; height: 46px; color: var(--white); background: #D3D3D3; border-radius: 50%; transition: background-color .25s; }
.navsocial a:hover, .navsocial a:focus-visible { background: var(--red); outline: none; }
.navtwin { display: flex; align-items: center; gap: 18px; font-size: 14px; line-height: 1.3; color: #333; text-decoration: none; }
.navtwin:hover i, .navtwin:focus-visible i { background: var(--red); }
.navtwin:focus-visible { outline: none; }

/* Responsive ------------------------------------------------------------- */

/* Tablet: 3 columns, 2 rows. No pattern strip on touch-size screens. */
@media (max-width: 1200px) {
  .navpanel__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 0; }
  .navcol { min-height: 360px; padding-bottom: 24px; }
  .navcol::after { display: none; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .navpanel__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone: one accordion row per section — tapping the tile opens its pages (js/nav.js) */
@media (max-width: 760px) {
  .navpanel { padding-top: calc(var(--safe-t) + 70px); }
  /* rows hug their content (no stretching to fill the screen) and form one continuous grey block */
  .navpanel__cols { flex: 0 0 auto; align-content: start; grid-template-columns: 1fr; gap: 0; margin-bottom: 18px; }
  .navcol { min-height: 0; padding: 5px; transition: background-color .4s var(--ease), padding .4s var(--ease); }
  .navcol.is-open { background: var(--white); padding-bottom: 16px; }
  .navcard { height: auto; min-height: 56px; padding: 10px 14px 10px 16px; flex-direction: row; align-items: center; gap: 12px; --cut: 12px; }
  .navcard b { font-size: 16px; }
  .navcard__arrow, .navcard__arrow svg { width: 16px; height: 16px; }
  .navcol.is-open .navcard__arrow { transform: rotate(45deg); }   /* ↘ turns to ↓ while the section is open */

  .navlinks { max-height: 0; margin: 0; padding: 0 10px; overflow: hidden; visibility: hidden;
    transition: max-height .5s var(--ease), margin .5s var(--ease), visibility 0s .5s; }
  .navcol.is-open .navlinks { max-height: 1200px; margin-top: 14px; visibility: visible; transition: max-height .6s var(--ease), margin .5s var(--ease), visibility 0s; }
  .navlinks li + li { margin-top: 4px; }
  .navlinks a { padding: 3px 0; font-size: 15px; }

  /* Footer: icons and the PDF-twin link share a row while they fit, then wrap */
  .navpanel__foot { flex-wrap: wrap; gap: 14px 20px; padding: 18px 0 calc(var(--safe-b) + 20px); }
  .navsocial { gap: 6px; }
  .navsocial a, .navtwin i { width: 40px; height: 40px; }
  .navsocial svg { width: 20px; height: 20px; }
  .navtwin { gap: 12px; font-size: 13px; }
}
/* Small phones: icons spread across the full width, the PDF-twin link on its own row below a hairline */
@media (max-width: 480px) {
  .navpanel__foot { flex-direction: column; align-items: stretch; gap: 0; padding-top: 16px; }
  .navsocial { justify-content: space-between; max-width: 240px; }
  .navtwin { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
}