:root {
  --ink: #1d1d1b;
  --muted: #6b6b66;
  --line: #e8e8e6;
  --bg: #ffffff;
  --card: #f4f4f2;
  --accent: #e86aa8;
  --radius: 12px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", "Zen Kaku Gothic New", system-ui, sans-serif;
  line-height: 1.6;
}
html[data-lang="ja"] body { font-family: "Jost", "Zen Kaku Gothic New", system-ui, sans-serif; line-height: 1.85; }
a { color: inherit; }
img { display: block; max-width: 100%; }

/* Bilingual: show only the active language */
html[data-lang="en"] [lang="ja"] { display: none !important; }
html[data-lang="ja"] [lang="en"] { display: none !important; }

/* Header: nav left, logo centre, social right (same as the Adobe Portfolio layout) */
.site-header {
  padding: 28px 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; text-transform: uppercase; font-size: 16px; font-weight: 300; letter-spacing: .02em; }
.nav a.active, .nav a:hover { font-weight: 600; }
.logo { font-weight: 600; font-size: clamp(22px, 2.4vw, 32px); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 22px; }
.social { display: flex; align-items: center; gap: 18px; }
.social a { text-decoration: none; display: flex; align-items: center; height: 24px; }
.social .be, .social .in { font-weight: 700; font-size: 20px; line-height: 1; }
.social a:hover { opacity: .6; }
.lang-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}
.lang-toggle .sep { margin: 0 5px; opacity: .5; }
html[data-lang="en"] .lang-toggle [data-set="en"],
html[data-lang="ja"] .lang-toggle [data-set="ja"] { color: var(--ink); font-weight: 600; }

main { max-width: var(--max); margin: 0 auto; padding: 0 34px; }

/* Hero: flower illustration with the greeting on the envelope */
.hero { padding: 40px 0 8px; }
.hero-inner { position: relative; max-width: 800px; margin: 0 auto; container-type: inline-size; }
.hero-img { width: 100%; height: auto; }
.hero-text { position: absolute; left: 22%; right: 22%; top: 75%; text-align: center; }
.hero-text h1 { margin: 0; font-weight: 500; font-size: 4.6cqw; line-height: 1.15; }
.hero-text p { margin: .5cqw 0 0; font-size: 2cqw; line-height: 1.45; color: #3a3a38; }

/* Category buttons, centred under the illustration */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 40px 0 44px; }
.filter {
  font: inherit;
  font-size: 15px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid #d6d6d2;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.filter:hover { border-color: var(--ink); }
.filter.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.card { text-decoration: none; display: block; }
.card[hidden] { display: none; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; position: relative; z-index: 1; }
.card:hover .thumb img { transform: scale(1.04); }
.ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.card-text h2 { font-size: 18px; margin: 12px 0 0; font-weight: 500; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }
.meta .year::before { content: "·"; margin: 0 8px; }

/* Project page */
.project { max-width: 960px; margin: 0 auto; padding-top: 56px; padding-bottom: 96px; }
.back a { color: var(--muted); text-decoration: none; font-size: 14px; }
.back a:hover { color: var(--ink); }
.project h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 500; line-height: 1.15; margin: 28px 0 16px; text-align: center; }
.subtitle { font-size: 19px; color: var(--muted); margin: 0 0 56px; text-align: center; }
.facts { display: flex; flex-wrap: wrap; gap: 16px 56px; margin: 0 0 56px; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 6px 0 0; }
.overview p { font-size: 17px; line-height: 1.8; margin: 0 0 88px; }
.images { display: grid; gap: 48px; }
.images figure { margin: 0; }
.img-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); min-height: 320px; }
.img-wrap img { width: 100%; position: relative; z-index: 1; }
.img-wrap:has(img) { min-height: 0; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Gallery (Logo Design Collection): rows like the original site.
   Images keep their order (left to right, top to bottom); each row shares one height. */
.images.gallery { display: flex; flex-wrap: wrap; gap: 10px; --h: 165px; }
.images.gallery::after { content: ""; flex-grow: 999; }
.images.gallery .tile { margin: 0; flex: var(--r) 1 calc(var(--r) * var(--h)); aspect-ratio: var(--r); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile.fit-contain img { object-fit: contain; padding: 4%; }
@media (max-width: 900px) { .images.gallery { --h: 130px; } }
@media (max-width: 600px) { .images.gallery { --h: 80px; gap: 6px; } }

figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; text-align: center; }
.more { margin-top: 128px; }
.more-title { font-size: 22px; font-weight: 500; margin: 0 0 28px; }

/* About */
.about { display: grid; grid-template-columns: 7fr 4fr; gap: 72px; padding: 24px 0 64px; align-items: start; max-width: 1100px; margin: 0 auto; }
.about-title { text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 24px 0 56px; }
.about-text { padding-top: 40px; }
.about-text a { text-underline-offset: 3px; }
.about-name { margin-bottom: 22px !important; }
.about-photo { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.about h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 500; margin: 0 0 16px; }
.about-text p { font-size: 17px; line-height: 1.8; margin: 0 0 18px; }
.about-links { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; }
.about-links a { text-decoration-color: var(--accent); text-underline-offset: 4px; }

/* Contact */
.contact { max-width: 640px; margin: 0 auto; padding: 32px 0; }
.contact h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 500; margin: 0 0 12px; }
.contact > p { color: var(--muted); margin: 0 0 28px; }
.form { display: grid; gap: 8px; }
.form label { font-size: 14px; margin-top: 10px; }
.form input, .form textarea {
  font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #d6d6d2; background: #fff; width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
.send {
  margin-top: 18px; justify-self: start; font: inherit; font-weight: 500;
  padding: 12px 28px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer;
}
.send:hover { opacity: .85; }

/* Footer */
.site-footer {
  max-width: var(--max); margin: 96px auto 0; padding: 32px 34px 56px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
}
.social-text { display: flex; gap: 20px; }
.social-text a { text-decoration: none; }
.social-text a:hover { color: var(--ink); }
.copy { margin: 0; }

/* Back-to-top button, bottom right */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 10;
  width: 60px; height: 60px; border-radius: 50%;
  background: #e2e2e0; color: #555;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: #d4d4d2; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about-text { padding-top: 0; }
  .about-photo { max-width: 360px; }
}
@media (max-width: 700px) {
  main { padding: 0 20px; }
  .hero-text h1 { font-size: 5.4cqw; }
  .hero-text p { font-size: 2.6cqw; }
  .hero-text { left: 18%; right: 18%; top: 74%; }
  .grid { grid-template-columns: 1fr; }
  .to-top { width: 48px; height: 48px; }
}

/* Image groups with a heading (e.g. T-shirt Design). Each row fills the width; images in a row share one height. */
.sections { display: grid; gap: 10px; }
.sections .row { display: flex; gap: 10px; }
.sections .row .tile { margin: 0; flex: var(--r) 1 0; aspect-ratio: var(--r); min-width: 0; overflow: hidden; }
.section-title { font-size: 18px; font-weight: 500; text-align: center; margin: 72px 0 14px; }
.overview a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 600px) { .sections .row { flex-wrap: wrap; } .sections .row .tile { flex-basis: 100%; } }
.section-gap { height: 62px; }
.sections .tile.fit-contain img { padding: 0; }
.sections > .section-title:first-child { margin-top: 0; }
.overview > div p { font-size: 17px; line-height: 1.8; margin: 0 0 18px; }
.overview > div p.list-head { margin: 26px 0 8px; font-weight: 500; }
.overview ul { margin: 0 0 88px; padding-left: 1.3em; font-size: 17px; line-height: 1.8; }
.overview ul li { margin-bottom: 4px; }
.visit { text-align: center; margin: -48px 0 64px; }
.visit-btn { display: inline-block; padding: 10px 26px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-size: 15px; }
.visit-btn:hover { opacity: .85; }
.section-caption { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.sections .row .tile:only-child { flex: 1 1 100%; }
.tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 36 Days of Type: the four animated grids join into one 6x6 board */
.sections.tight > .row:nth-of-type(-n+2) { gap: 0; }
.sections.tight { row-gap: 10px; }
.sections.tight > .row:first-child { margin-bottom: -10px; }
.facts dd a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* Full-width rows that run edge to edge of the browser window */
.sections .row.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.sections .row.full-bleed .tile { border-radius: 0; }
html, body { overflow-x: hidden; }
/* Embedded InDesign publications */
.embed { max-width: 640px; margin: 0 auto; width: 100%; aspect-ratio: 525 / 371; }
.embed iframe { width: 100%; height: 100%; border: 1px solid #777; display: block; }
.tile.missing { position: relative; background: var(--card); }
/* Image with its own caption inside a row (e.g. reference photos with sources) */
.sections .row .tile-wrap { flex: var(--r) 1 0; min-width: 0; }
.sections .row .tile-wrap .tile { width: 100%; }
.tile-cap { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0 0; }
.tile-cap .src a { text-underline-offset: 2px; }

.section-sub { text-align: center; color: var(--muted); font-size: 14px; margin: -8px 0 18px; }

.contact .mail { margin: 32px 0 0; }
.tile-cap a { text-underline-offset: 3px; }

/* Header layout: on desktop the menu wrapper disappears so nav / logo / icons sit in three columns */
.menu { display: contents; }
.site-header .nav { grid-column: 1; grid-row: 1; }
.site-header .logo { grid-column: 2; grid-row: 1; }
.site-header .header-right { grid-column: 3; grid-row: 1; }
.menu-btn { display: none; }

/* Mobile: logo left, hamburger right, menu opens as a full-screen panel */
@media (max-width: 700px) {
  .site-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; position: relative; z-index: 50; }
  .logo { font-size: 20px; position: relative; z-index: 60; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 40px; height: 40px; padding: 8px; margin-right: -8px; background: none; border: 0; cursor: pointer; position: relative; z-index: 60; }
  .menu-btn span { display: block; height: 2px; width: 24px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
  .site-header.open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .site-header.open .menu-btn span:nth-child(2) { opacity: 0; }
  .site-header.open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .menu { display: none; position: fixed; inset: 0; background: #fff; z-index: 55; flex-direction: column; align-items: center; justify-content: center; gap: 40px; }
  .site-header.open .menu { display: flex; }
  .menu .nav { flex-direction: column; align-items: center; gap: 22px; }
  .menu .nav a { font-size: 22px; }
  .menu .header-right { flex-direction: column; gap: 28px; }
  body.menu-open { overflow: hidden; }
}
