/* TUCA — language switcher and CJK type.
   Loaded on every document (including the case pages, which do not use
   tuca-overrides.css). Keep it limited to the language control and the
   CJK font/leading adjustments. */
/* ---------------------------------------------------------------- language
   One compact control in the navbar for every breakpoint. It sits inside
   .navbar-right, which is painted above the fixed mobile menu, so it stays
   reachable while the hamburger overlay is open. */
.tuca-lang { position: relative; font-family: var(--font-secondary); font-size: .75em; }
.tuca-lang-btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .5em .75em;
  border: 1px solid var(--brand-black); border-radius: .25em;
  background-color: transparent; color: var(--brand-black);
  font: inherit; letter-spacing: .09em; line-height: 1; text-transform: uppercase;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.tuca-lang-btn:hover,
.tuca-lang.is-open .tuca-lang-btn { background-color: var(--brand-black); color: var(--brand-accent); }
.tuca-lang-chev { flex: none; transition: transform .18s ease; }
.tuca-lang.is-open .tuca-lang-chev { transform: rotate(180deg); }
.tuca-lang-menu {
  display: none; flex-direction: column;
  position: absolute; top: calc(100% + .55em); right: 0; z-index: 60;
  min-width: 11.5em; padding: .3em;
  background-color: var(--brand-accent);
  border: 1px solid var(--brand-black); border-radius: .25em;
  box-shadow: 0 .5em 1.4em rgba(0, 0, 0, .12);
}
.tuca-lang.is-open .tuca-lang-menu { display: flex; }
.tuca-lang-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1.6em;
  padding: .6em .65em;
  color: var(--brand-black); text-decoration: none; white-space: nowrap;
}
.tuca-lang-item:hover { background-color: rgba(0, 0, 0, .07); }
.tuca-lang-item.is-active { background-color: var(--brand-black); color: var(--brand-accent); }
.tuca-lang-short { opacity: .5; font-size: .85em; letter-spacing: .09em; }
.tuca-lang-item.is-active .tuca-lang-short { opacity: .75; }
@media (max-width: 479px) {
  /* the CTA is hidden here, so the 4em gap would only push the switcher left */
  .navbar-right { grid-column-gap: 1.25em; }
  .tuca-lang-menu { right: -.5em; }
}

/* --------------------------------------------------------------- CJK type
   MD Nichrome and Neue Montreal have no CJK glyphs; keep the Latin display
   face first so brand words stay intact and let the rest fall back cleanly. */
html[lang="ja"] {
  --font-primary: Mdnichrometest, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --font-secondary: Neuemontreal, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
}
html[lang="zh-Hans"] {
  --font-primary: Mdnichrometest, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-secondary: Neuemontreal, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}

/* CJK display type: full-width glyphs at the Latin 8em overrun the container,
   and the 80% line-height makes two CJK lines collide. Cap the hero headline
   at five glyphs per line so it keeps the two-line composition. */
html[lang="ja"] .heading,
html[lang="zh-Hans"] .heading,
html[lang="ja"] .section-heading,
html[lang="zh-Hans"] .section-heading { line-height: 1.12; }
/* full-width glyphs read wider than the condensed Latin face, so pull the
   display sizes back one step on the about/work heroes */
html[lang="ja"] .heading,
html[lang="ja"] .heading.right-align,
html[lang="ja"] .heading.right-align.less-max,
html[lang="zh-Hans"] .heading,
html[lang="zh-Hans"] .heading.right-align,
html[lang="zh-Hans"] .heading.right-align.less-max { font-size: 9em; }
/* Size the hero headline from its own container so five full-width glyphs
   fill a line at every breakpoint and the two-line composition survives. */
html[lang="ja"] .hero-text,
html[lang="zh-Hans"] .hero-text { width: 100%; container-type: inline-size; }
html[lang="ja"] .hero-text .heading,
html[lang="zh-Hans"] .hero-text .heading {
  font-size: 7em;                 /* fallback where cqw is unsupported */
  font-size: min(7em, 16.2cqw);
  max-width: 5.2em;
  margin-left: auto;
  margin-right: auto;
}

/* At wide sizes the five-glyph block is narrower than the Latin headline, so
   the pills float in the margins beside it. */
@media (min-width: 992px) {
  html[lang="ja"] .hero-pill.one,
  html[lang="zh-Hans"] .hero-pill.one { left: 4%; top: 30%; }
  html[lang="ja"] .hero-pill.two,
  html[lang="zh-Hans"] .hero-pill.two { right: 3%; top: 4%; }
  html[lang="ja"] .hero-pill.three,
  html[lang="zh-Hans"] .hero-pill.three { right: 4%; bottom: -2%; }
}

/* Below that the lines fill the width, so the pills stack under the headline
   instead of crossing the type. */
@media (max-width: 991px) {
  html[lang="ja"] .hero-text,
  html[lang="zh-Hans"] .hero-text { padding-bottom: 150px; }
  html[lang="ja"] .hero-pill.one,
  html[lang="zh-Hans"] .hero-pill.one { left: 16px; top: auto; bottom: 104px; }
  html[lang="ja"] .hero-pill.two,
  html[lang="zh-Hans"] .hero-pill.two { left: auto; right: 16px; top: auto; bottom: 56px; }
  html[lang="ja"] .hero-pill.three,
  html[lang="zh-Hans"] .hero-pill.three { right: 16px; bottom: 8px; }
}

/* the service labels travel along a fixed path; Japanese labels are much
   wider than the Latin ones at the same size and would collide */
html[lang="ja"] .service-block { font-size: .66em; }

/* phrase-aware line breaking keeps Japanese headings from splitting inside a
   word ("TUCAがやっ / ていること"). Unsupported browsers keep normal breaking. */
html[lang="ja"] .section-heading,
html[lang="ja"] .heading,
html[lang="ja"] .about-para { word-break: auto-phrase; }

/* the pinned about statement is set for ~35 Latin characters per line; the
   Japanese sentence needs a smaller size to stay inside the same block */
@media (min-width: 992px) {
  html[lang="ja"] .about-para { font-size: 4em; }
}

/* the narrow three-line heading holds three Latin words but only three CJK
   glyphs; five glyphs per line keeps it to two lines */
html[lang="ja"] .section-heading.less-max-w,
html[lang="zh-Hans"] .section-heading.less-max-w { max-width: 5em; }

/* the value cards use an 80% line-height for the condensed Latin face, which
   makes CJK lines collide */
html[lang="ja"] .value-heading,
html[lang="zh-Hans"] .value-heading,
html[lang="ja"] .about-story-heading,
html[lang="zh-Hans"] .about-story-heading { line-height: 1.05; }
html[lang="ja"] .value-heading,
html[lang="ja"] .about-story-heading { word-break: auto-phrase; }

/* the contact overlay stacks four 80%-leading lines; CJK glyphs fill the em
   box, so they need real leading to stop colliding */
html[lang="ja"] .contact-heading,
html[lang="zh-Hans"] .contact-heading { line-height: 1.02; }

/* the contact overlay holds three entries now (WhatsApp, inquiries, e-mail),
   so the reference's 3.75em stack gap leaves no clearance above the
   illustration */
@media (min-width: 480px) {
  .contact-right { grid-row-gap: 2.6em; }
}

/* the closing line is twelve full-width glyphs at 32px and runs off a 390px
   screen; shrink it just enough to fit the column */
@media (max-width: 479px) {
  html[lang="ja"] .contact-para { font-size: 1.6em; }
}

/* The LET'S TALK illustration is bottom-anchored at a fixed 25em, while the
   contact column ends at about half the viewport height. On short desktop
   viewports the placard's top corner grew into the e-mail line, so cap the
   height against the viewport instead of letting it fight the copy. */
@media (min-width: 992px) {
  .contact-img-wrap { height: min(25em, calc(44svh - 24px)); }
}

/* Below 992px the overlay stacks and centres its copy, so the bottom-right
   illustration always ends up under the text (and the contact list is now
   three entries tall). Drop the decoration there rather than let it cross
   the copy. */
@media (max-width: 991px) {
  /* the overlay embed ships `.contact-img-wrap { display: flex !important }`,
     so this needs both `!important` and a higher-specificity selector */
  html .contact-img-wrap { display: none !important; }
}

/* Between 480px and 991px the overlay heading (the "proyek" line carries the
   reference's -.8em stagger) is wider than the column and the first glyphs get
   clipped by the overlay's overflow: hidden. Soften the stagger there so the
   word stays whole; above 992px the column is wide enough for the full shift. */
@media (min-width: 480px) and (max-width: 991px) {
  .contact-heading.right { transform: translate(-.35em); }
}

/* Case hero: the work phrase sits under the brand name so the page says its
   job out loud — the same string as the tab title, the card labels and the
   anchors pointing here. This file loads on every document, all locales. */
.project-page-sub {
  font-family: var(--font-secondary);
  margin-top: .6em;
  font-size: clamp(.8em, .95vw, 1em);
  line-height: 130%;
}

/* About door sentence: quiet inline anchors, no Webflow link colour. */
.about-hero-para a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

/* ---------------------------------------------------------------- footer
   The reference pins .footer to exactly one viewport (height: 100svh). On
   phones the stacked contact/menu block plus the wordmark no longer fit,
   so flexbox shrank .footer-btm below its content height and the TUCA
   wordmark was cut mid-glyph at the bottom of the scroll range. Let the
   footer grow instead, stop the shrink, and clear the fixed 78px navbar
   with the top padding. */
@media (max-width: 767px) {
  .footer { height: auto; min-height: 100svh; }
  .footer-wrapper {
    height: auto;
    padding-top: 6.5em;
    padding-bottom: 1.25em;
  }
  .footer-btm { flex-shrink: 0; }
  /* the wordmark SVG ships as width/height 100% of an auto-height box; keep
     it on its own aspect ratio so its flow height stays definite */
  .footer-svg-logo svg {
    display: block;
    height: auto;
    aspect-ratio: 1400 / 309;
  }
}
