/* TEIKAKAI — static site styles */
:root {
  --ink: #111;
  --muted: #555;
  --line: #e4e2dd;
  --paper: #fff;
  --accent: #8a6d2f;
  --gutter: clamp(16px, 6vw, 96px);
  --font: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
.lang-zh { --font: "Noto Serif SC", "Shippori Mincho", "Songti SC", "Hiragino Mincho ProN", serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) var(--gutter);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 18px var(--gutter);
  background: var(--paper);
}
.brand {
  display: flex; align-items: center; gap: 16px;
  text-decoration: none;
}
.brand img { width: clamp(44px, 5vw, 64px); height: auto; }
.brand span {
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: .14em;
  white-space: nowrap;
}
.site-nav {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px clamp(20px, 4vw, 56px);
  font-size: 14px;
  letter-spacing: .14em;
}
.site-nav a {
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.site-nav a:hover { border-color: currentColor; }
.site-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

/* Footer */
.site-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 24px;
  padding: 28px var(--gutter);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}
.lang-switch a:hover { border-color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Shared typography */
.page-title {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.3;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head.center { text-align: center; }
.section-head .page-title { margin-bottom: 8px; }
.dash { display: block; font-size: 28px; line-height: 1; }
.tagline { font-size: 20px; letter-spacing: .12em; margin-top: 12px; }

/* Home hero */
.hero {
  position: relative;
  min-height: max(560px, calc(100svh - 100px));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  background: #1d2433 url("/assets/img/hero.jpg") center 35% / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  /* Soft darkening around the slogan so white text reads on the bright sky. */
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(10,14,24,.38), rgba(10,14,24,0) 75%),
    rgba(10,14,24,.12);
}
.hero-inner {
  position: relative;
  /* Extra bottom padding lifts the block slightly above the vertical center. */
  padding: 24px var(--gutter) clamp(80px, 14vh, 160px);
}
/* Letter-spacing adds trailing space after the last glyph; offset it so text stays optically centered. */
.hero-lines span, .hero-name, .hero-sub { padding-left: .1em; }
.hero-name, .hero-sub { padding-left: .15em; }
.hero-lines {
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 60px);
  line-height: 1.7;
  letter-spacing: .1em;
  margin-bottom: clamp(24px, 4vh, 48px);
}
.hero-lines span { display: block; }
.lang-en .hero-lines { letter-spacing: .04em; font-size: clamp(28px, 4vw, 52px); }
.hero-title { font-weight: 400; margin: 0; }
.hero-title span { display: block; }
.hero-name, .hero-sub {
  font-size: clamp(15px, 1.6vw, 22px);
  letter-spacing: .15em;
  line-height: 1.8;
}

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}
.about-text { max-width: 560px; }
.about-text p { font-size: clamp(16px, 1.5vw, 19px); line-height: 2; margin-bottom: 1.6em; }
.lang-en .about-text p { line-height: 1.85; }
.about-photo { margin: clamp(0px, 8vw, 110px) 0 0; }
.about-photo img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 40% center; }

/* Portfolio cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px;
  margin-top: clamp(40px, 6vw, 80px);
}
.cards:has(> :only-child) { max-width: 880px; margin-inline: auto; }
.card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10;
  color: #fff; text-decoration: none;
  background: #222;
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, filter .6s ease; }
.card::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); transition: background .4s; }
.card-title {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: .14em;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.card:hover img, .card:focus-visible img { transform: scale(1.04); }
.card:hover::after, .card:focus-visible::after { background: rgba(0,0,0,.32); }

/* Project gallery */
.back { margin-bottom: 20px; font-size: 14px; letter-spacing: .1em; }
.back a { text-decoration: none; color: var(--muted); }
.back a:hover { color: var(--ink); }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.gallery-item { display: block; overflow: hidden; background: #eee; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover img { transform: scale(1.03); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(10,10,10,.94);
}
.lightbox::backdrop { background: rgba(10,10,10,.94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: fixed;
  background: none; border: 0; color: #fff;
  font: 300 44px/1 sans-serif;
  cursor: pointer; padding: 12px 18px; opacity: .8;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Contact */
.contact p { font-size: clamp(16px, 1.6vw, 20px); line-height: 2; margin-bottom: 1.4em; max-width: 46em; }
.contact .email a { color: var(--accent); text-underline-offset: 4px; }

/* 404 */
.notfound p { margin-bottom: .8em; }

@media (max-width: 760px) {
  .site-header { padding-block: 14px; }
  .site-nav { width: 100%; justify-content: flex-start; font-size: 13px; }
  .about { grid-template-columns: 1fr; }
  .about-photo { margin-top: 0; }
  .about-photo img { aspect-ratio: 4 / 3; }
  .hero { min-height: max(480px, calc(100svh - 130px)); background-position: 30% center; }
  /* CJK lines are ~10 characters: size them to the screen so each stays on one row. */
  .hero-lines { font-size: 7.4vw; letter-spacing: .08em; }
  .lang-en .hero-lines { font-size: 5.6vw; letter-spacing: .02em; }
  .hero-lines span, .hero-sub { text-wrap: balance; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
