/* ============================================================
   RYU3D — design tokens
   Surface ladder (dark, warm): floor → surface → card → hover
   Hairline borders instead of shadows. One accent, used sparingly.
   ============================================================ */
:root {
  --bg0: #0e0d0c;
  --bg1: #141312;
  --bg2: #191816;
  --bg3: #201e1b;
  --line: #2a2823;
  --line-strong: #3d3a32;
  --ink: #f2efe8;
  --ink-dim: #a8a399;
  --ink-faint: #6e6a60;
  --accent: #f08c3a;
  --font-display: "Futura", "Century Gothic", "Avenir Next", "Jost", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", "Futura", "Century Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
  --pad: clamp(20px, 5vw, 72px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

html { overflow-x: clip; }
body {
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain overlay — baked noise tile, barely-there */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../assets/grain.png") repeat;
  background-size: 96px 96px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

.mono { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; }
.accent { color: var(--accent); }
.en { display: block; color: var(--ink-faint); font-size: 0.85em; margin-top: 0.35em; }

::selection { background: var(--accent); color: var(--bg0); }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg0) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: 0.28em; font-size: 0.95rem;
}
.nav-brand img { display: block; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav-links a {
  color: var(--ink-dim); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--accent); }
.nav-status { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
@media (max-width: 720px) {
  .nav { padding: 12px 16px; }
  .nav-status { display: none; }
  .nav-brand span { display: none; }
  .nav-links { gap: 18px; }
  .nav-links a.nav-opt { display: none; }
  .hero-meta { flex-wrap: wrap; }
  .hero-scrollcue { display: none; }
  .skills div { grid-template-columns: 96px 1fr; }
  .footer-cta .btn { width: 100%; text-align: center; }
  .contact-form .form-grid { grid-template-columns: 1fr; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 110px var(--pad) 28px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-align: center;
}
#lattice { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; }
.hero-ball {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  margin-top: clamp(4px, 1vw, 16px);
  min-height: 0;
}
.hero-ball::before {
  content: "";
  position: absolute;
  width: min(80vw, 720px); height: min(80vw, 720px);
  border-radius: 50%;
  background: radial-gradient(circle, #3a2c1e 0%, rgba(20, 19, 18, 0) 68%);
}
#scrub-canvas {
  position: relative;
  width: min(86vw, 62vh, 720px);
  height: auto; aspect-ratio: 1;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
}
.hero-kicker { color: var(--ink-faint); margin-bottom: 14px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
}
.hero-role {
  font-family: var(--font-display);
  letter-spacing: 0.42em;
  font-size: clamp(0.72rem, 1.5vw, 0.95rem);
  color: var(--ink-dim);
  margin-top: 12px;
}
.hero-tagline { color: var(--ink-faint); margin-top: 12px; font-size: 0.95rem; }
.hero-meta {
  position: relative; z-index: 1;
  width: 100%;
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 20px;
  color: var(--ink-faint);
}
.hero-scrollcue { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ============ SECTIONS ============ */
.section { padding: clamp(72px, 10vw, 140px) var(--pad); border-bottom: 1px solid var(--line); }
/* anchor targets land below the fixed nav */
.section, .footer { scroll-margin-top: 64px; }
.section-head {
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: clamp(32px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.section-no { color: var(--accent); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  font-weight: 700; letter-spacing: 0.08em; line-height: 1.1;
}
.section-sub { color: var(--ink-faint); margin-left: auto; }
.section-desc { max-width: 640px; color: var(--ink-dim); margin-bottom: clamp(28px, 4vw, 48px); }

/* ============ FLAGSHIP ============ */
.flagship {
  display: grid; grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: clamp(24px, 4vw, 64px); align-items: start;
}
.lead { font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 2; }
.spec { width: 100%; border-collapse: collapse; margin-top: 32px; table-layout: fixed; }
.spec td { overflow-wrap: anywhere; }
.spec th, .spec td {
  text-align: left; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 400; font-size: 0.72rem; letter-spacing: 0.1em;
}
.spec th { color: var(--ink-faint); width: 38%; }
.spec td { color: var(--ink); }

@media (max-width: 900px) {
  .flagship { grid-template-columns: 1fr; }
}

/* ============ STRIP (variant row) ============ */
.strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: clamp(40px, 6vw, 80px);
}
.strip-2 { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
.strip-3 { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.strip-1 { grid-template-columns: min(100%, 540px); justify-content: center; margin-top: 0; }
.strip-1 img { aspect-ratio: auto; }
.strip figure {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #2a2721 0%, var(--bg1) 62%, var(--bg0) 100%);
}
.strip img { width: 100%; display: block; aspect-ratio: 1; object-fit: contain; padding: 4%; }
.strip figcaption {
  padding: 12px 16px; color: var(--ink-faint);
  border-top: 1px solid var(--line); text-align: center;
}
/* catalog cards: photos with baked light background */
.strip figure.light { background: #f6f5f2; }
.strip figure.light img { padding: 0; object-fit: cover; }
.strip figure.light figcaption {
  color: #6e6a60;
  border-top-color: rgba(25, 24, 22, 0.12);
}
@media (max-width: 720px) { .strip { grid-template-columns: 1fr; } }

/* ============ GALLERY (ReSOU / concept) ============ */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.g-item {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--bg1); margin: 0;
}
.g-wide { grid-column: span 2; }
.g-item img {
  width: 100%; height: 100%; display: block; aspect-ratio: 1;
  object-fit: cover; transition: transform 0.5s ease;
}
.g-wide img { aspect-ratio: 2.05 / 1; }
.g-item:hover img { transform: scale(1.03); }
.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 16px 12px;
  color: var(--ink);
  background: linear-gradient(180deg, transparent 0%, rgba(14, 13, 12, 0.85) 100%);
}
@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .g-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .g-wide { grid-column: auto; }
}
.section-cta { margin-top: clamp(28px, 4vw, 48px); }

/* ============ BENTO ============ */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--bg1);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.tile:hover { border-color: var(--line-strong); background: var(--bg2); transform: translateY(-3px); }
.tile-wide { grid-column: span 2; }
.tile-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg2); }
.tile-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease, opacity 0.45s ease;
}
.tile:hover .tile-media img { transform: scale(1.03); }
.tile-media-dark {
  background: radial-gradient(circle at 50% 42%, #2a2721 0%, var(--bg1) 62%, var(--bg0) 100%);
}
.tile-media-dark img { object-fit: contain; padding: 3%; }
.tile-body { padding: 20px 22px 24px; }
.tile-body h3 {
  font-family: var(--font-display); letter-spacing: 0.12em;
  font-size: 1.02rem; margin-bottom: 8px;
}
.tile-body p { color: var(--ink-dim); font-size: 0.88rem; }
.tile-body .en { font-size: 0.8rem; }
.tile-tags { display: block; margin-top: 14px; color: var(--ink-faint); }

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .tile-wide { grid-column: auto; }
}

/* ============ ABOUT ============ */
.about { position: relative; display: grid; grid-template-columns: 6fr 5fr; gap: clamp(28px, 5vw, 72px); }
.skills { display: flex; flex-direction: column; gap: 0; }
.skills div {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
}
.skills dt { color: var(--ink-faint); }
.skills dd { color: var(--ink); }
.about-mark {
  position: absolute; right: 0; bottom: -40px;
  width: clamp(150px, 24vw, 300px); opacity: 0.05; pointer-events: none;
}
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ============ FOOTER ============ */
.footer {
  padding: clamp(80px, 12vw, 160px) var(--pad) 48px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 115%, #2a1e12 0%, var(--bg0) 62%);
}
.footer-kicker { color: var(--accent); margin-bottom: 20px; }
.footer-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  font-weight: 700; letter-spacing: 0.04em; line-height: 1.05;
  margin-bottom: 44px;
}
.contact-form {
  max-width: 720px;
  display: flex; flex-direction: column; gap: 18px;
  margin-bottom: 24px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; color: var(--ink-faint); }
.contact-form input, .contact-form textarea {
  background: var(--bg1);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form button { align-self: flex-start; cursor: pointer; }
.footer-alt { color: var(--ink-faint); margin-bottom: clamp(48px, 8vw, 96px); }
.footer-alt a { color: var(--ink-dim); }
.footer-alt a:hover { color: var(--accent); }
.footer-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.footer-sns {
  display: flex; gap: clamp(18px, 3vw, 32px); flex-wrap: wrap;
  margin-bottom: clamp(64px, 10vw, 120px);
}
.footer-sns a { color: var(--ink-dim); text-decoration: none; transition: color 0.2s; }
.footer-sns a:hover { color: var(--accent); }
.btn {
  display: inline-block; padding: 16px 34px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em;
  color: var(--bg0); background: var(--accent);
  text-decoration: none; border-radius: 6px;
  border: 1px solid var(--accent);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(240, 140, 58, 0.35); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.footer-meta {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--ink-faint);
}
.footer-meta a { color: var(--ink-faint); text-decoration: none; }
.footer-meta a:hover { color: var(--accent); }

/* ============ REVEAL ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
