/* Personal portfolio overrides — loaded after the original stylesheets. */

/* Text copy of the hero image for screen readers and AI agents
   (tools/make_profile.py). Standard visually-hidden pattern. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The hero's yellow side is now kv_back_me.jpg (photo sticker). Hide the
   animated "Welcome" baku that the script places over the old artwork. */
.home_kv_baku {
  display: none !important;
}

/* About block below the hero: English copy (tools/set_about.py). The original
   font is a Japanese web font with wide tracking; English reads better tighter. */
.home_about_text {
  font-family: Montserrat, sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.9;
}

.home_about_text {
  text-wrap: pretty; /* no single word left alone on a paragraph's last line */
}
@media not screen and (min-width: 769px) {
  .home_about_text {
    padding: 0 20px; /* the longer English text ran to the screen edges */
    font-size: clamp(15px, 3.9vw, 18px); /* Junni's 13px suited Japanese; English needs more */
    line-height: 1.75;
    letter-spacing: 0.01em;
  }
}

/* Line breaks that only apply on wider screens; phones wrap naturally. */
@media (max-width: 576px) {
  .br-desktop {
    display: none;
  }
}

/* "PROJECTS" (8 letters) replaces "WORKS" (5); scale the outlined title so it
   still fits the screen width (originally min(288px, 18vw)). */
.home_works_title.repeatText {
  font-size: min(224px, 14vw);
}
@media not screen and (min-width: 769px) {
  .home_works_title.repeatText {
    font-size: min(119px, 14vw);
  }
}

/* Same for "EXPERIENCE" (10 letters) replacing "SERVICE" (7). */
.home_service_title.repeatText {
  font-size: min(182px, 11.4vw);
}
@media not screen and (min-width: 769px) {
  .home_service_title.repeatText {
    font-size: min(97px, 11.4vw);
  }
}

/* TOOLS & TECH (was the AWARDS logo wall; tools/set_tools.py). */
.home_award_title.repeatText {
  font-size: min(150px, 9.4vw);
  white-space: nowrap;
}
.home_awards_list {
  grid-template-columns: repeat(6, 1fr);
  gap: min(56px, 3.6vw) min(32px, 2vw);
}
.home_tools_group {
  grid-column: 1 / -1;
  margin-top: min(36px, 2.4vw);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(211, 255, 2, 0.35);
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d3ff02;
  text-align: left;
  align-items: flex-start;
}
.home_tools_group:first-child {
  margin-top: 0;
}
/* the original only staggers the first 7 items; keep later ones in step */
.is-scroll-anime .home_awards_item:nth-of-type(n + 8) {
  transition-delay: 0.42s;
}
.home_awards_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.home_awards_item img {
  width: auto;
  height: min(88px, 6.5vw);
}
.home_tools_name {
  font-family: Montserrat, sans-serif;
  font-weight: 500;
  font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0.04em;
  color: #f7f7f7;
}
@media not screen and (min-width: 769px) {
  .home_award_title.repeatText {
    font-size: min(80px, 9.4vw);
  }
  .home_awards_list {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 14px;
  }
  .home_awards_item img {
    height: 48px;
  }
}

/* CERTIFICATIONS (was RECRUIT; tools/set_certs.py). */
.home_recruit_title.repeatText {
  font-size: min(130px, 7.6vw);
  white-space: nowrap;
}
.home_recruit_text {
  font-family: Montserrat, sans-serif;
  letter-spacing: 0.01em;
}
.home_recruit_text_item {
  text-wrap: balance;     /* the one-paragraph intro: no lone last word */
}
@media (max-width: 768px) {
  .home_recruit_text_item {
    padding-inline: 20px;   /* keep the paragraph off the phone's edges */
  }
}
.home_certs_list {
  line-height: 2.1;
}
.home_certs_list b {
  font-weight: 700;
}
.home_certs_issuer {
  opacity: 0.6;
  font-size: 0.82em;
}
/* certificates are landscape documents: show them whole on a white card
   (the photo slots were portrait/square, zoomed 130% and stretched) */
.home_recruit_image[data-image] {
  padding-top: 0;
  aspect-ratio: 1.31;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
/* keep the edge slots fully on screen (the photos used to bleed off) */
.home_recruit_image[data-image=image_0] { width: min(340px, 21%); left: 2%; }
.home_recruit_image[data-image=image_1] { width: min(380px, 24%); }
.home_recruit_image[data-image=image_2] { width: min(300px, 19%); }
.home_recruit_image[data-image=image_3] { width: min(340px, 21%); right: 2%; }
.home_recruit_image_inner {
  transform: translate(-50%, -50%);
}
.home_recruit_image_inner img {
  object-fit: contain;
}
/* designed credential cards (slot_style "cards", tools/cert-cards): dark,
   rounded, lifted off the page instead of white paper */
.home_recruit_image[data-image]:has(img[src*="/card_"]) {
  background: #17181c;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.home_recruit_image[data-image] img[src*="/card_"] {
  object-fit: cover;
  transform: none !important;   /* the script's inner parallax slid the card down, leaving a gap at the top */
}
.home_recruit_mainImage_item[data-item=front] {
  background: #fff url(/assets/images/home/certs/palantir.webp) center / contain no-repeat;
}
.home_recruit_mainImage_item[data-item=back] {
  background: #fff;
}
.home_recruit_mainImage_item[data-item=back] img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Flip side of the main card: the logo banner (tools/set_certs.py, banner()).
   Like Junni's reel on this card: dark ground, iridescent glass in motion,
   big type behind. Sizes follow the card (container units), so it scales
   from desktop to phone. */
.home_recruit_mainImage_item[data-item=back]:has(.cert_banner) {
  background: #141518;
}
.cert_banner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6cqh;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(211, 255, 2, 0.10), transparent 60%),
    linear-gradient(160deg, #1b1c21, #0e0f12);
}
.cert_banner_blob {
  position: absolute;
  width: 62cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(9cqh);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: cert-banner-drift 16s ease-in-out infinite alternate;
}
.cert_banner_blob-a { background: #d3ff02; left: -18cqw; top: -40cqh; }
.cert_banner_blob-b { background: #ff3fb4; right: -22cqw; top: 10cqh; animation-duration: 19s; animation-delay: -6s; opacity: 0.42; }
.cert_banner_blob-c { background: #35c8ff; left: 22cqw; bottom: -62cqh; animation-duration: 22s; animation-delay: -11s; opacity: 0.38; }
@keyframes cert-banner-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12cqw, 8cqh) scale(1.12); }
  100% { transform: translate(-6cqw, 14cqh) scale(0.94); }
}
.cert_banner_word {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font: 900 34cqh/1 Montserrat, sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: max(1px, 0.25cqh) rgba(255, 255, 255, 0.16);
  pointer-events: none;
}
.cert_banner_row {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.cert_banner_track {
  display: flex;
  gap: 4cqw;
  width: max-content;
  padding: 2cqh 0;
  animation: cert-banner-slide 36s linear infinite;
}
.cert_banner_row[data-row="1"] .cert_banner_track {
  animation-direction: reverse;
  animation-duration: 42s;
}
@keyframes cert-banner-slide {
  to { transform: translateX(calc(-50% - 2cqw)); }
}
/* frosted glass: milky fill, bright top edge, soft inner glow and shadow */
.cert_banner_tile {
  position: relative;
  display: grid;
  place-items: center;
  height: 27cqh;
  padding: 0 5cqh;
  border-radius: 4cqh;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78) 55%, rgba(236, 240, 250, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1.2cqh 2.4cqh rgba(53, 200, 255, 0.10),
    0 2cqh 5cqh rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.cert_banner_tile::after {        /* a light sweep across the glass */
  content: "";
  position: absolute;
  inset: -50% auto -50% -60%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: rotate(18deg);
  animation: cert-banner-sheen 6s ease-in-out infinite;
}
@keyframes cert-banner-sheen {
  0%, 70% { left: -60%; }
  100% { left: 140%; }
}
.home_recruit_mainImage_item[data-item=back] .cert_banner_tile img {
  width: auto;
  height: calc(27cqh * var(--logo));   /* --logo: share of the tile height, per logo */
  max-width: none;
  object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
  .cert_banner_track, .cert_banner_blob, .cert_banner_tile::after { animation: none; }
}
@media not screen and (min-width: 769px) {
  .home_recruit_title.repeatText {
    font-size: min(70px, 7.6vw);
  }
  .home_recruit_image[data-image] {
    padding-top: 0;
    width: min(200px, 30%);
  }
  .home_recruit_image[data-image=image_0] { left: 2%; }
  .home_recruit_image[data-image=image_3] { right: 2%; }
  .home_recruit_image_inner {
    transform: translate(-50%, -50%);
  }
}

/* Footer menu: labels are longer now (EXPERIENCE, CERTIFICATIONS), so size the
   two columns to their content instead of a fixed 27% width. */
@media only screen and (min-width: 950px) {
  .footer_menu {
    width: max-content;
    grid-template-columns: auto auto;
    column-gap: 2.2em;
  }
}

/* Footer PAGE TOP: hovering flips the arrow to a dark card (the site's own
   flip) where the tiki mascot hops, fans its feathers and squints
   (tools/set_pagetop.py puts the SVG in; Junni had a baku lottie here). */
.footer_pageTop_item[data-hover=after] .footer_pageTop_item_inner {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.tiki {
  /* 78% of the card height; the card is min(258px, 16.125vw) wide at 258:160 */
  height: min(125px, 7.8vw);
  width: auto;
  overflow: visible;
  color: #d3ff02;
}
.tiki_part {
  transform-box: fill-box;
}
.tiki_feather {
  transform-origin: 50% 100%;
}
.tiki_eyes {
  transform-origin: 50% 50%;
}
.footer_pageTop:hover .tiki {
  animation: tiki-hop 0.9s 0.25s cubic-bezier(0.3, 0, 0.3, 1) infinite;
  transform-origin: 50% 100%;
}
.footer_pageTop:hover .tiki_feather {
  animation: tiki-fan 0.9s 0.25s ease-in-out infinite;
}
.footer_pageTop:hover .tiki_feather-1 { --fan: -16deg; }
.footer_pageTop:hover .tiki_feather-2 { --fan: -8deg; animation-delay: 0.31s; }
.footer_pageTop:hover .tiki_feather-3 { --fan: 0deg; animation-delay: 0.37s; }
.footer_pageTop:hover .tiki_feather-4 { --fan: 8deg; animation-delay: 0.43s; }
.footer_pageTop:hover .tiki_feather-5 { --fan: 16deg; animation-delay: 0.49s; }
.footer_pageTop:hover .tiki_eyes {
  animation: tiki-squint 1.8s 0.25s ease-in-out infinite;
}
@keyframes tiki-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  10% { transform: translateY(0) scale(1.06, 0.92); }   /* crouch */
  45% { transform: translateY(-14%) scale(0.97, 1.04); } /* up toward the top */
  80% { transform: translateY(0) scale(1.04, 0.95); }   /* land */
}
@keyframes tiki-fan {
  0%, 100% { transform: rotate(0) scaleY(1); }
  45% { transform: rotate(var(--fan)) scaleY(1.12); }
}
@keyframes tiki-squint {
  0%, 60%, 100% { transform: scaleY(1); }
  70% { transform: scaleY(0.55); }
  80% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .footer_pageTop:hover .tiki,
  .footer_pageTop:hover .tiki_part {
    animation: none;
  }
}

/* Contact chat (menu → CONTACT; text in tools/set_contact.py). Its Japanese
   web font isn't loaded and doesn't suit English; use the site's Montserrat.
   The CONTACT US title keeps the logo-style font. */
#contact :is(input, textarea, select, button, label, p, li, span, div):not([class*="_title_"]) {
  font-family: Montserrat, sans-serif;
}
#contact [class*="_message_detail_"] {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}
#contact [class*="_select_label_"] {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* After a message is sent the form slides in a "thank you" mascot (Junni's
   baku-thankyou lottie, which isn't here). Show the tiki with a speech bubble. */
#contact [data-lottie="baku-thankyou"] {
  right: 16px; /* the baku peeked in from off-screen; keep the tiki fully visible */
  background: url(/assets/images/mascot/tiki_ink.svg) right 18px bottom / auto 84% no-repeat;
}
#contact [data-lottie="baku-thankyou"] > * {
  display: none;
}
#contact [data-lottie="baku-thankyou"]::before {
  content: "Thanks for reaching out — talk soon ♡"; /* shown after message, email or call */
  position: absolute;
  right: 118px;
  bottom: 70%;
  width: 190px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 7px #0000001a;
  font: 500 14px/1.45 Montserrat, sans-serif;
  color: #1c1d21;
}

/* Menu panel: longer labels (CERTIFICATIONS) and a gap between social links */
.nav_sns {
  column-gap: 1.2em;
}
@media only screen and (min-width: 769px) {
  .nav_item_link {
    font-size: 20px; /* CERTIFICATIONS fits the 256px menu area even beside the contact panel */
  }
}

/* Phones: the floating certificate cards drift up (parallax, up to 260px)
   over the certification list. Start them 140px lower; `translate` stacks
   with the script's transform instead of replacing it. !important because
   GSAP writes an inline `translate: none` when it animates the cards. */
@media not screen and (min-width: 769px) {
  .home_recruit_image[data-image] {
    translate: 0 140px !important;
  }
}

/* Phones: "CERTIFICATIONS" made the two-column footer menu wider than the
   screen. Scale it with the viewport (≈13px on a 375px phone). */
@media not screen and (min-width: 950px) {
  .footer_menu {
    font-size: min(24px, 3.4vw);
  }
}

/* Project detail pages (/works/<slug>, tools/make_project_page.py): English
   copy in Montserrat instead of the Japanese web font, and the demo video. */
.works_detail_name_sub,
.works_detail_item_desc_text,
.works_detail_credit_name,
.works_detail_body,
.works_detail_body :is(p, h2, strong, a, figcaption) {
  font-family: Montserrat, sans-serif;
  letter-spacing: 0.01em;
  word-break: normal; /* the Japanese layout breaks anywhere, splitting English words */
  overflow-wrap: break-word;
}
.works_detail_body h2 {
  font-weight: 700;
  line-height: 1.4;
}
.works_detail_body p {
  line-height: 1.9;
}
.works_detail_media {
  margin: 0;
}
.works_detail_media :is(video, img) {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #000;
}
.works_detail_media figcaption {
  margin-top: 0.8em;
  font-size: 0.85em;
  opacity: 0.6;
}

/* About page (/about, tools/make_about.py): English copy in Montserrat
   instead of the Japanese web font, the VISION tagline (was Junni's slogan
   artwork) and Tiki in the mascot spot. */
[class^=about_] .sectionTitle_ja,
.about_mission_theme_text,
.about_mission_text_item,
.about_vision_desc_text,
.about_vision_text_item,
.about_value_item_heading_ja,
.about_value_item_sub,
.about_value_item_detail,
.about_outline_item_term,
.about_outline_item_desc,
.about_character_name,
.about_character_text_item {
  font-family: Montserrat, sans-serif;
  letter-spacing: 0.02em;
  word-break: normal;
}
.about_mission_theme_text {
  letter-spacing: 0.01em;
}
/* CHARACTER description: a touch more air between lines than Junni's 2.14
   (English sits lower in the line box than Japanese) */
.about_character_text {
  line-height: 2.3;
  letter-spacing: 0.03em;
}
@media not screen and (min-width: 769px) {
  .about_character_text {
    padding: 0 20px; /* the text ran to the screen edges */
  }
}
/* CHARACTER: no word left alone on a paragraph's last line; the short opening
   paragraph splits into even lines */
.about_character_text_item {
  text-wrap: pretty;
}
.about_character_text_item:first-child {
  text-wrap: balance;
}
.about_character_text_item:not(:first-of-type) {
  margin-top: 0.9em; /* Junni's 2.27em gap read as two separate blocks */
}
/* English paragraphs run longer than Junni's hand-broken lines */
.about_mission_text_item,
.about_vision_text_item,
.about_character_text_item {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.about_vision_theme {
  width: auto;
}
.about_vision_tagline {
  margin: 0;
  font: 700 min(84px, 6vw) / 1.05 Caveat, cursive; /* the hero's handwriting */
  text-align: center;
  white-space: nowrap;
  color: #1c1d21;
}
.about_outline_link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.about_outline_link:hover {
  text-decoration-thickness: 2px;
}
.about_outline_link + .about_outline_link {
  margin-left: 2.5em; /* Find me: LinkedIn and GitHub side by side */
}
/* PROFILE ends on the Find me row; without bottom padding the dark CHARACTER
   section started right under it (and the golden-ratio drawing ran into it) */
.about_outline {
  padding-bottom: min(200px, 13vw);
}
@media not screen and (min-width: 769px) {
  .about_outline {
    padding-bottom: 96px;
  }
}
@media not screen and (min-width: 769px) {
  .about_vision_tagline {
    font-size: min(52px, 12vw);
  }
}

/* Hero, yellow side: it is cut into tiles for the flip, and the tiles' rounded
   corners and fractional widths left hairline yellow seams across the photo and
   the status pill. Square corners plus a 1px overlap make it read as one
   picture. The dark front keeps its tile grid (part of the design). */
.home_kv_panel_item[data-panel-item=back] {
  border-radius: 0;
  width: calc(100% + 1px);
  height: calc(100% + 1px);
}

/* Hero artwork (both sides, desktop + mobile) comes from the images in
   assets/images/home/kv/*_me.jpg. On phones the tiles only get sliced once the
   works videos load, so assets/images/works/*_min.mp4 must exist (currently
   symlinks to the desktop videos). */
