/* ============================================================
   Tsuyoshi Kameda / Portfolio (faithful rebuild, plain HTML/CSS/JS)
   ============================================================ */

:root {
  --black: #080808;
  --white: #f8f9fa;
  --gray: #2b2b2b;
  --dark-gray: #1c1c1c;
  --light-gray: #8e8e8e;
  --border: #212121;

  --c-uxui: #8ce99a;
  --c-websites: #e599f7;
  --c-graphics: #74c0fc;
  --c-videos: #ffc078;

  --highlight: #ffe066;

  --frame-w: 1152px;
  --header-h: 72px;

  --font-sans: "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Shadows Into Light", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 1.1em;
  line-height: 1;
  vertical-align: middle;
}

/* ---- central framed column with side borders ---- */
.frame {
  max-width: var(--frame-w);
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

.section {
  padding: 72px 56px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: var(--white);
  white-space: nowrap;
}
.logo .l-sm { font-family: var(--font-hand); font-size: 19px; line-height: 1; }
.logo .l-tsu { align-self: flex-start; transform: translateY(1px); }
.logo .l-i { align-self: flex-end; transform: translateY(-1px); }
.logo .l-main {
  font-family: var(--font-hand);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0 auto;
}
.nav-item { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
  padding: 8px 2px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-link .caret { font-size: 18px; transition: transform 0.2s ease; }
.nav-link.disabled { color: var(--light-gray); cursor: default; }
.nav-link.is-active { color: var(--white); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 18px; bottom: -2px;
  height: 2px;
  background: var(--highlight);
  border-radius: 2px;
}

/* dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-item:hover > .nav-link .caret { transform: rotate(180deg); }
.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--white);
  white-space: nowrap;
}
.dropdown a:hover { background: var(--dark-gray); }

.header-right { display: flex; align-items: center; gap: 14px; }

/* language toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: #0d0d0d;
}
.lang-toggle button {
  border: none;
  background: none;
  color: var(--light-gray);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  letter-spacing: 0.3px;
}
.lang-toggle button.is-active {
  background: var(--white);
  color: var(--black);
}

.btn-talk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.btn-talk:hover { background: var(--dark-gray); border-color: #333; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  padding: 96px 56px;
}
.hero-greeting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 0;
}
.hero-name {
  display: inline-block;
  background: var(--highlight);
  color: #111;
  padding: 4px 16px;
  border-radius: 6px;
}
.hero-tagline {
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 18px 0 0;
}
.hero-desc {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--light-gray);
  font-size: 16px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 40px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--dark-gray);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.18s ease;
}
.btn-primary:hover { background: var(--gray); }
.link-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--light-gray);
  font-size: 15px;
  transition: color 0.18s ease;
}
.link-ghost:hover { color: var(--white); }

/* ============================================================
   Work
   ============================================================ */
.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
}
.work-title {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
}
.work-viewall {
  color: var(--light-gray);
  font-size: 15px;
  transition: color 0.18s ease;
}
.work-viewall:hover { color: var(--white); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}
.card { display: block; }
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--dark-gray);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card-media img { transform: scale(1.04); }
.card-title {
  margin: 16px 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
}
.card-desc {
  margin: 0;
  color: var(--light-gray);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { padding: 80px 56px 40px; }
.footer-logo {
  font-family: var(--font-hand);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--white);
  margin-bottom: 44px;
}
.footer-logo .l-sm { font-family: var(--font-hand); font-size: 42px; line-height: 1; }
.footer-logo .l-tsu { align-self: flex-start; transform: translateY(4px); }
.footer-logo .l-i { align-self: flex-end; transform: translateY(-4px); }
.footer-logo .l-main { font-size: 72px; line-height: 1; }

.footer-cta {
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1px;
  margin: 0 0 64px;
}
.footer-cta .pen { font-size: 0.72em; color: var(--highlight); vertical-align: baseline; }
.footer-cta .cta2 { color: var(--light-gray); display: inline-block; transition: color 0.18s ease; }
.footer-cta a:hover .cta2 { color: var(--white); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.footer-meta { color: var(--light-gray); font-size: 14px; line-height: 1.8; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 48px;
}
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--light-gray);
}
.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--white);
  margin-bottom: 9px;
}
.footer-col a:hover { color: var(--light-gray); }
.footer-col a.disabled { color: var(--light-gray); pointer-events: none; }
.footer-col .ext { font-size: 15px; color: var(--light-gray); }

/* ============================================================
   Mobile menu (hamburger)
   ============================================================ */
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .section, .hero, .site-footer { padding-left: 28px; padding-right: 28px; }
  .nav { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    margin-left: auto;
    margin-right: 12px;
  }
  .menu-toggle .material-symbols-outlined { font-size: 26px; }
  .btn-talk .label { display: none; }
  .btn-talk { padding: 10px; }

  .work-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-bottom { flex-direction: column; }
  .footer-cols { grid-template-columns: repeat(2, auto); gap: 28px 40px; }

  /* mobile nav panel */
  .nav.open {
    display: flex;
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background: #0b0b0b;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 24px;
  }
  .nav.open .nav-item { width: 100%; }
  .nav.open .nav-link { justify-content: space-between; width: 100%; padding: 14px 0; }
  .nav.open .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 8px 12px;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .work-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 460px; padding-top: 64px; padding-bottom: 64px; }
}

/* ============================================================
   Inner pages (About / Work) shared
   ============================================================ */
.page-hero { padding: 120px 56px 72px; }
.page-hero h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 800; letter-spacing: -1.4px; line-height: 1.1; margin: 0;
}

.subnav {
  position: sticky; top: var(--header-h); z-index: 40;
  display: flex; gap: 36px; padding: 0 56px;
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.subnav a { position: relative; padding: 18px 2px; font-size: 15px; color: var(--light-gray); transition: color 0.18s ease; }
.subnav a:hover { color: var(--white); }
.subnav a.is-active { color: var(--white); }
.subnav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--highlight); }

.row { display: grid; grid-template-columns: 320px 1fr; gap: 40px; padding: 64px 56px; border-bottom: 1px solid var(--border); }
.row-label { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--white); letter-spacing: -0.4px; }
.row-body { max-width: 760px; }
.row-body p { margin: 0 0 18px; color: var(--light-gray); line-height: 1.8; }
.row-body p:last-child { margin-bottom: 0; }
.lead { color: var(--white) !important; font-size: 17px; }

.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 48px; }
.exp-item { border-left: 2px solid var(--border); padding-left: 18px; }
.exp-role { font-size: 13px; color: var(--light-gray); margin: 0 0 2px; }
.exp-company { font-size: 19px; font-weight: 700; color: var(--white); margin: 0 0 10px; }
.exp-meta { font-size: 13px; color: var(--light-gray); margin: 0 0 12px; }
.exp-meta span { margin-right: 14px; }
.exp-tags { font-size: 13px; color: var(--light-gray); margin: 0 0 12px; line-height: 1.6; }
.exp-desc { font-size: 14px; color: var(--light-gray); line-height: 1.75; margin: 0; }

.block { margin-bottom: 30px; }
.block:last-child { margin-bottom: 0; }
.block h3 { font-size: 18px; font-weight: 700; color: var(--white); margin: 0 0 8px; }
.block p { margin: 0; color: var(--light-gray); line-height: 1.8; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.chip { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: #0d0d0d; font-size: 13px; color: var(--white); }

.tool-list { display: flex; flex-direction: column; gap: 22px; }
.tool-row { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: start; }
.tool-name { font-size: 14px; font-weight: 600; color: var(--white); }
.tool-row p { margin: 0; color: var(--light-gray); font-size: 14px; line-height: 1.7; }

.steps { display: flex; flex-direction: column; gap: 30px; }
.step { display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start; }
.step-num { font-size: 44px; font-weight: 800; color: var(--gray); line-height: 1; }
.step h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: var(--white); }
.step p { margin: 0; color: var(--light-gray); line-height: 1.7; }

.lang-rows { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.lang-row { display: flex; align-items: center; gap: 14px; }
.lang-badge { width: 40px; height: 40px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--white); }
.lang-name { font-weight: 600; color: var(--white); }
.lang-level { color: var(--light-gray); font-size: 14px; }

.cert-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--light-gray); font-size: 14px; }
.cert-link:hover { color: var(--white); }

.work-listing { padding-top: 40px; }

@media (max-width: 900px) {
  .page-hero { padding: 96px 28px 56px; }
  .subnav { padding: 0 28px; gap: 24px; }
  .row { grid-template-columns: 1fr; gap: 20px; padding: 44px 28px; }
  .exp-grid { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 100px 1fr; }
}

/* Work sub-nav uses the UX/UI category accent (green) */
.subnav.is-work a.is-active { color: var(--c-uxui); }
.subnav.is-work a.is-active::after { background: var(--c-uxui); }
.subnav a.is-muted { color: var(--gray); cursor: default; }

/* ============================================================
   Case study (project detail)
   ============================================================ */
.case-head { padding: 56px 56px 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--light-gray); font-size: 14px; margin-bottom: 28px; transition: color .18s ease; }
.back-link:hover { color: var(--white); }
.case-title { font-size: clamp(34px, 4.4vw, 52px); font-weight: 800; letter-spacing: -1.4px; margin: 0 0 14px; }
.case-sub { font-size: clamp(17px, 2vw, 22px); color: var(--light-gray); max-width: 820px; margin: 0; line-height: 1.5; }

.case-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 56px; margin-top: 40px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.case-meta h4 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--white); }
.meta-items { display: flex; flex-wrap: wrap; gap: 8px 0; }
.meta-items span { font-size: 13px; color: var(--light-gray); }
.meta-items span:not(:last-child)::after { content: "|"; margin: 0 10px; color: var(--gray); }

.case-cover { padding: 44px 56px; }
.case-cover img { width: 100%; border-radius: 12px; display: block; border: 1px solid var(--border); }

.case-main { padding: 0 56px 24px; }
.sec { padding: 40px 0; border-bottom: 1px solid var(--border); }
.sec:last-child { border-bottom: none; }
.phase-label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--light-gray); margin: 0 0 8px; }
.sec-title { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.8px; margin: 0 0 28px; }
.sec-lead { color: var(--light-gray); line-height: 1.8; max-width: 880px; margin: 0 0 18px; }

.blk { margin-bottom: 30px; max-width: 880px; }
.blk:last-child { margin-bottom: 0; }
.blk h3 { font-size: 17px; font-weight: 700; color: var(--white); margin: 0 0 10px; }
.blk p { margin: 0; color: var(--light-gray); line-height: 1.9; }

/* design-process stepper */
.stepper { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.stepper .stp { flex: 0 0 210px; border: 1px solid var(--border); border-radius: 12px; background: #0d0d0d; padding: 18px; }
.stepper .stp h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .8px; color: var(--white); }
.stepper .stp p { margin: 0; font-size: 13px; color: var(--light-gray); line-height: 1.6; }
.stepper .arr { flex: 0 0 auto; align-self: center; color: var(--gray); }

/* personas */
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 720px; }
.persona { border: 1px solid var(--border); border-radius: 14px; padding: 28px 20px; text-align: center; background: #0d0d0d; }
.persona .avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.persona .a-mgr { background: #3f6fb5; }
.persona .a-office { background: #d36a6a; }
.persona h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--white); }
.persona .p-meta { font-size: 12.5px; color: var(--light-gray); margin: 0 0 14px; }
.persona .p-pain { font-size: 13.5px; color: var(--white); margin: 0; line-height: 1.6; }

/* core action flow */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.flow .node { border: 1px solid var(--border); border-radius: 999px; padding: 10px 20px; background: #0d0d0d; font-size: 14px; font-weight: 600; color: var(--white); }
.flow .arr { color: var(--gray); }

/* image rows with captions */
.img-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.img-row figure { margin: 0; }
.img-row img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; aspect-ratio: 16/10; object-fit: cover; background: var(--dark-gray); }
.img-row figcaption { margin-top: 10px; font-size: 13px; color: var(--light-gray); text-align: center; }
.single-img { margin: 8px 0 0; }
figure.single-img + figure.single-img, .blk + figure.single-img { margin-top: 24px; }
.single-img figcaption { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--light-gray); }
.single-img img { width: 100%; max-width: 880px; border-radius: 10px; border: 1px solid var(--border); display: block; }

/* other projects */
.other-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.other-card { display: flex; gap: 16px; align-items: center; }
.other-card img { width: 92px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; border: 1px solid var(--border); }
.other-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--white); }
.other-card p { margin: 0; font-size: 13px; color: var(--light-gray); line-height: 1.55; }

@media (max-width: 900px) {
  .case-head { padding: 44px 28px 8px; }
  .case-meta { grid-template-columns: 1fr; gap: 24px; padding: 28px; }
  .case-cover { padding: 28px; }
  .case-main { padding: 0 28px 16px; }
  .persona-grid { grid-template-columns: 1fr 1fr; }
  .img-row { grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .persona-grid { grid-template-columns: 1fr; }
}

/* phone (portrait) image rows for mobile-app case studies */
.img-row--phone img { aspect-ratio: 750 / 1624; }
/* show the whole image (no crop) when a row's screens are not 16:10 */
.img-row--natural img { aspect-ratio: auto; }
.persona-grid.cols-3 { grid-template-columns: repeat(3, 1fr); max-width: none; }
@media (max-width: 760px){ .persona-grid.cols-3 { grid-template-columns: 1fr; } }

/* persona emoji avatars */
.persona .avatar { overflow: hidden; }
.avatar-emoji { font-size: 52px; line-height: 1; }

/* HMW sticky-note cards */
.hmw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 16px;
  max-width: 880px;
}
.sticky {
  position: relative;
  background: #ffe35c;
  color: #3a2f00;
  font-family: var(--font-hand);
  font-size: 19px;
  line-height: 1.45;
  padding: 30px 18px 44px;
  min-height: 168px;
  border-radius: 2px;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}
.sticky:hover { transform: rotate(0deg) scale(1.02); }
.sticky::before {
  content: "";
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 60px; height: 16px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
}

/* ============================================================
   Character avatars & service logos (assets/img/Graphics)
   ============================================================ */
/* persona character illustration (already a circular avatar) */
.avatar-img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  background: #2a2a2a;
}

/* small service logo inside chips / tool names / meta */
.chip-logo {
  width: 18px; height: 18px;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}
.chip.has-logo { gap: 8px; }

/* AI tools list logos (Tools I Use page) */
.tool-name.has-logo { display: flex; align-items: center; gap: 10px; }
.tool-name.has-logo .chip-logo { width: 24px; height: 24px; border-radius: 6px; }
.tool-list .tool-row { grid-template-columns: 156px 1fr; }

/* case-study Tools meta as logo chips */
.logo-chips { display: flex; flex-wrap: wrap; gap: 9px 14px; }
.lchip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--light-gray); }

@media (max-width: 900px) {
  .tool-list .tool-row { grid-template-columns: 120px 1fr; }
}

/* ============================================================
   UX enhancements
   ============================================================ */

/* progressive reveal on scroll (only when JS is active) */
html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* image fade-in on load */
img.fade-img { opacity: 0; transition: opacity 0.5s ease; }
img.fade-img.loaded { opacity: 1; }

/* card hover lift */
.card { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card:hover { transform: translateY(-5px); }
.card-media { transition: box-shadow 0.28s ease; }
.card:hover .card-media { box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55); }

/* button press feedback */
.btn-primary:active, .btn-talk:active, .scroll-top:active { transform: scale(0.96); }

/* scroll-to-top button */
.scroll-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, visibility 0.25s;
  z-index: 60;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
.scroll-top.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { background: var(--dark-gray); }

/* reading progress bar (case studies) */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0;
  background: var(--highlight);
  z-index: 70;
  transition: width 0.08s linear;
}

/* header elevation once scrolled */
.site-header { transition: box-shadow 0.25s ease, background 0.25s ease; }
.site-header.scrolled {
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.5);
  background: rgba(8, 8, 8, 0.85);
}

/* skip link */
.skip-link {
  position: fixed;
  top: -70px; left: 14px;
  z-index: 200;
  background: var(--highlight);
  color: #111;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px; font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 14px; }

/* visible focus rings for keyboard users */
a:focus-visible,
button:focus-visible,
.card:focus-visible,
.lang-toggle button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, img.fade-img { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .card:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ============================================================
   Refinement pass: text color, sizing, responsive, menu
   ============================================================ */

/* --- text color & hierarchy --- */
:root { --light-gray: #9a9a9a; --muted: #5c5c5c; }
.hero-desc, .row-body p, .sec-lead, .card-desc, .exp-desc { color: #a7adb3; }   /* brighter body text for comfort */
.nav-link.disabled, .footer-col a.disabled, .subnav a.is-muted { color: var(--muted); }

/* --- desktop nav hover affordance --- */
.nav-link:not(.disabled):not(.is-active) { position: relative; }
.nav-link:not(.disabled):not(.is-active)::after {
  content: ""; position: absolute; left: 0; right: 18px; bottom: -2px;
  height: 2px; background: var(--white); transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s ease; border-radius: 2px;
}
.nav-item:hover > .nav-link:not(.disabled):not(.is-active)::after { transform: scaleX(1); }

/* --- fluid heading sizes (smaller floor for small screens) --- */
.hero-greeting, .hero-tagline { font-size: clamp(31px, 5.6vw, 64px); }
.page-hero h1 { font-size: clamp(28px, 5vw, 56px); }
.case-title { font-size: clamp(30px, 4.4vw, 52px); }
.footer-cta { font-size: clamp(30px, 4.4vw, 52px); }
.sec-title { font-size: clamp(24px, 3vw, 36px); }
/* keep Japanese from breaking mid-word where possible */
.hero-greeting, .hero-tagline, .page-hero h1, .case-title, .footer-cta, .sec-title { line-break: strict; overflow-wrap: anywhere; }

/* ============================================================
   Mobile / tablet (<= 900px) — header + full-screen menu
   ============================================================ */
@media (max-width: 900px) {
  /* header layout: logo left, actions, hamburger far right */
  .site-header { padding: 0 20px; }
  .logo { order: 1; }
  .header-right { order: 2; margin-left: auto; gap: 8px; }
  .menu-toggle { order: 3; margin: 0 0 0 8px; }
  .lang-toggle { padding: 2px; }
  .lang-toggle button { padding: 5px 9px; font-size: 11.5px; }

  /* full-screen opaque menu (no content bleed) */
  .nav.open {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    height: auto;
    min-height: calc(100vh - var(--header-h));
    background: #0a0a0a;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 24px 48px;
    z-index: 45;
    animation: menuIn 0.22s ease;
  }
  .nav.open .nav-item { width: 100%; border-bottom: 1px solid var(--border); }
  .nav.open .nav-item:last-child { border-bottom: none; }
  .nav.open .nav-link { font-size: 18px; font-weight: 500; padding: 18px 2px; }
  .nav.open .caret { display: none; }
  .nav.open .dropdown { padding: 0 0 14px 14px; }
  .nav.open .dropdown a { font-size: 15px; padding: 11px 0; color: var(--light-gray); }
  .nav.open .dropdown a:hover { background: transparent; color: var(--white); }
  @keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

  /* hero breathing room on small screens */
  .hero { min-height: auto; padding: 64px 20px 56px; }
  .hero-desc { font-size: 15px; }
  .section, .work, .site-footer { padding-left: 20px; padding-right: 20px; }
}

/* very small screens */
@media (max-width: 420px) {
  .lang-toggle button { padding: 5px 7px; font-size: 11px; }
  .btn-talk { padding: 9px; }
  .case-meta { padding: 24px 20px; }
}

/* ============================================================
   Mobile menu: in-menu contact CTA + structure
   ============================================================ */
.nav-cta { display: none; }   /* desktop keeps "Let's talk" in the header */

@media (max-width: 900px) {
  /* contact moves into the menu on phones */
  .header-right .btn-talk { display: none; }

  .nav.open { display: flex; flex-direction: column; }

  /* clearer grouping: section headers vs sub-items */
  .nav.open .nav-link:not(.disabled) { font-weight: 700; color: var(--white); }
  .nav.open .nav-item .dropdown {
    padding: 2px 0 16px 16px;
    margin: 0 0 0 2px;
    border-left: 2px solid var(--border);
  }
  .nav.open .dropdown a { font-size: 15px; font-weight: 400; padding: 12px 0; }

  /* primary contact action at the bottom of the menu */
  .nav.open .nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    padding: 17px 24px;
    border-radius: 999px;
    background: var(--highlight);
    color: #111;
    font-size: 16px;
    font-weight: 700;
  }
  .nav.open .nav-cta:active { transform: scale(0.98); }
  .nav.open .nav-cta .material-symbols-outlined { font-size: 20px; }

  /* 2026-11-15: menu fixes
     - the header's backdrop-filter makes it the containing block of the fixed
       menu (Safari), so drop it while the menu is open and make the header solid
     - the panel is opaque from the first frame; only the items fade in
     - lock page scroll on <html> too (iOS ignores body overflow)
     - use the visible viewport height (dvh) so the contact button isn't under the toolbar */
  /* only <html>: hiding body overflow too would make <body> the scroller and
     the sticky header would jump back to the top of the page */
  html.menu-open { overflow: hidden; }
  html.menu-open .scroll-top { display: none; }
  html.menu-open .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #0a0a0a;
    box-shadow: none;
  }
  .nav.open {
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    min-height: 0;
    animation: none;
    overscroll-behavior: contain;
  }
  .nav.open > * { animation: menuItemIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .nav.open > *:nth-child(2) { animation-delay: 0.04s; }
  .nav.open > *:nth-child(3) { animation-delay: 0.08s; }
  .nav.open > *:nth-child(4) { animation-delay: 0.12s; }
  @keyframes menuItemIn { from { opacity: 0; transform: translateY(-6px); } }
  /* sub-items: a straight guide line (desktop dropdown radius/bridge don't apply here) */
  .nav.open .nav-item .dropdown { border-radius: 0; min-width: 0; }
  .nav.open .dropdown::before { display: none; }
  .nav.open .nav-link.disabled { color: var(--muted); font-weight: 500; }

  /* About: collapsible sub-menu (closed until tapped) */
  .nav.open .has-sub > .nav-link { justify-content: space-between; }
  .nav.open .has-sub > .nav-link .caret {
    display: inline-block;
    font-size: 24px;
    color: var(--light-gray);
    transform: none;   /* ignore the desktop hover rotation (sticky :hover on touch) */
    transition: transform 0.25s ease;
  }
  .nav.open .has-sub.sub-open > .nav-link .caret { transform: rotate(180deg); }
  .nav.open .has-sub > .dropdown { display: none; }
  .nav.open .has-sub.sub-open > .dropdown {
    display: block;
    animation: subIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes subIn { from { opacity: 0; transform: translateY(-6px); } }
  /* current page: no desktop underline in the menu; highlight the sub-item instead */
  .nav.open .nav-link.is-active::after { display: none; }
  .nav.open .dropdown a[aria-current="page"] { color: var(--highlight); font-weight: 600; }
}
/* tablet: a full-width 720px pill looks heavy; size it to its content */
@media (min-width: 600px) and (max-width: 900px) {
  .nav.open { padding-left: 40px; padding-right: 40px; }
  .nav.open .nav-cta { align-self: flex-start; padding: 16px 36px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .nav.open > * { animation: none; }
}

/* ============================================================
   2026-11-15 fixes
   ============================================================ */

/* hero links: name → About Overview, "UX/UI" → Work */
/* hover matches the Studio site: name yellow → orange, "UX/UI" gets a green highlight (0.3s) */
a.hero-name { text-decoration: none; transition: background-color 0.3s ease; }
a.hero-name:hover { background: #f08c00; }
.hero-link { color: inherit; text-decoration: none; transition: background-color 0.3s ease, color 0.3s ease; }
.hero-link:hover { background: var(--c-uxui); color: #080808; }

/* dropdown: invisible bridge over the 14px gap so the menu doesn't close
   while the pointer travels from the link to the menu, plus a short close delay */
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; }
.dropdown { transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.25s; }
.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown { transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s; }

/* footer: stack links with real tap targets */
.footer-col { display: flex; flex-direction: column; align-items: flex-start; }
.footer-col a { margin: 0; padding: 7px 0; min-height: 36px; }
.footer-col h4 { margin-bottom: 6px; }

/* web screenshots: show the whole screen (no 16:10 crop that cut off side menus) */
.img-row { align-items: start; }
.img-row:not(.img-row--phone) img { aspect-ratio: auto; height: auto; object-fit: contain; }

/* work cards: richer hover */
.card-media img { transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease; }
.card:hover .card-media img { transform: scale(1.09); filter: saturate(1.15) brightness(0.82); }
.card-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px 9px 16px;
  border-radius: 999px;
  background: var(--white); color: #111;
  font-size: 14px; font-weight: 600;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-cta .material-symbols-outlined { font-size: 18px; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.card:hover .card-overlay, .card:focus-visible .card-overlay { opacity: 1; }
.card:hover .card-cta, .card:focus-visible .card-cta { transform: none; }
.card:hover .card-cta .material-symbols-outlined { transform: translate(2px, -2px); }
.card:active .card-media img { transform: scale(1.04); transition-duration: 0.2s; }
@media (hover: none) { .card-overlay { display: none; } }

/* page transitions (Chrome / Edge / Safari 18+): cross-fade pages and morph
   the clicked card image into the case cover */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .case-cover img { view-transition-name: case-hero; }
  ::view-transition-group(case-hero) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  ::view-transition-old(root) { animation: vt-out 0.35s ease both; }
  ::view-transition-new(root) { animation: vt-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}
@keyframes vt-out { to { opacity: 0; transform: scale(0.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* scroll reveal: slightly softer, with a blur-in */
html.js .reveal { transform: translateY(28px); filter: blur(4px); transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease; transition-delay: calc(var(--i, 0) * 70ms); }
html.js .reveal.in { filter: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { filter: none !important; } }
html.js .card.reveal.in:hover { transform: translateY(-5px); transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { html.js .card.reveal.in:hover { transform: none; } }
