/* Syota Nyumura — portfolio. Dark, bold, scroll-reveal, responsive. */
:root {
  --bg: #0a0b0d;
  --bg-elev: #121419;
  --bg-elev2: #1a1d24;
  --border: #262a32;
  --text: #f2f4f8;
  --text-dim: #99a2b2;
  --text-faint: #626b7a;
  --accent: #5b8cff;
  --accent2: #3fd0a4;
  --amber: #f0b429;
  --red: #f47272;
  --sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---- scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- header ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(10, 11, 13, 0.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { opacity: 1; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 15px; border-radius: 10px; color: var(--text-dim);
  font-size: 14.5px; font-weight: 500; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev2); opacity: 1; }
.nav-links a.active { color: var(--accent); }
.nav-toggle { display: none; }

/* ---- hero ---- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 100px 0 60px; position: relative; }
.hero .eyebrow { font-family: var(--mono); font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 20px; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 11vw, 132px); line-height: 0.98; letter-spacing: -0.03em;
  margin: 0; color: var(--text);
}
.hero h1 .l2 { color: var(--text-dim); }
.hero .tagline { font-size: clamp(16px, 2.4vw, 22px); color: var(--text-dim); max-width: 620px; margin: 28px 0 0; }
.scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  color: var(--text-faint); font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue .bar { width: 1px; height: 46px; background: linear-gradient(var(--text-faint), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; } 50% { transform: scaleY(1); opacity: 1; transform-origin: top; } }

/* ---- sections ---- */
.section { padding: 100px 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: none; }
.section-head { margin-bottom: 48px; }
.section-head .idx { font-family: var(--mono); font-size: 14px; color: var(--accent); letter-spacing: 0.12em; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 52px); letter-spacing: -0.02em; margin: 8px 0 0; line-height: 1.1; }
.section-head .sub { color: var(--text-dim); margin-top: 12px; font-size: 15.5px; }
.view-all { display: inline-block; margin-top: 32px; font-family: var(--mono); font-size: 14px; color: var(--accent); }
.view-all:hover { padding-left: 4px; transition: padding 0.2s; }

/* ---- page head (sub pages) ---- */
.page-head { padding: 140px 0 20px; }
.page-head .idx { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.12em; }
.page-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 6vw, 60px); letter-spacing: -0.02em; margin: 8px 0 0; }
.page-head .sub { color: var(--text-dim); margin-top: 10px; }
.back-link { display: inline-block; margin: 130px 0 0; font-family: var(--mono); font-size: 14px; color: var(--text-dim); }

/* ---- landing entries ---- */
.entries { display: grid; gap: 0; }
.entry {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 32px 4px; border-top: 1px solid var(--border); color: var(--text);
  transition: padding 0.25s ease;
}
.entry:last-child { border-bottom: 1px solid var(--border); }
.entry:hover { padding-left: 18px; opacity: 1; }
.entry .en { font-family: var(--display); font-size: clamp(26px, 5vw, 44px); font-weight: 700; letter-spacing: -0.02em; }
.entry .jp { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.entry .arrow { font-family: var(--mono); color: var(--accent); font-size: 22px; transition: transform 0.25s ease; }
.entry:hover .arrow { transform: translateX(8px); }

/* ---- about ---- */
.about-text { font-size: clamp(18px, 2.6vw, 26px); line-height: 1.7; color: var(--text); max-width: 820px; font-weight: 400; }
.about-text strong { color: var(--accent); font-weight: 700; }

/* ---- chips ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 3px 12px; border-radius: 999px; background: var(--bg-elev2); color: var(--text-dim); border: 1px solid var(--border); }

/* ---- career: skill sheet ---- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 26px 28px; margin-bottom: 18px; }
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.job-title { font-family: var(--display); font-size: 20px; font-weight: 700; }
.job-period { color: var(--accent2); font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.job-table { display: grid; grid-template-columns: 130px 1fr; gap: 12px 22px; margin: 0; font-size: 15px; }
.job-table dt { color: var(--text-faint); font-weight: 600; font-size: 13.5px; padding-top: 3px; }
.job-table dd { margin: 0; }
@media (max-width: 560px) { .job-table { grid-template-columns: 1fr; gap: 3px; } .job-table dt { margin-top: 12px; } }

/* ---- portfolio: image-first ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.pf-card { display: block; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; color: var(--text); transition: transform 0.25s ease, border-color 0.25s ease; }
.pf-card:hover { transform: translateY(-6px); border-color: var(--accent); opacity: 1; }
.pf-thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; background: var(--bg-elev2); }
.pf-thumb-ph { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg-elev2), #23283180); color: var(--text-faint); font-family: var(--display); font-size: 46px; font-weight: 700; }
.pf-body { padding: 18px 20px 22px; }
.pf-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.pf-year { color: var(--text-faint); font-weight: 500; font-size: 13px; font-family: var(--mono); }
.pf-desc { color: var(--text-dim); font-size: 14.5px; margin: 0 0 12px; }

/* ---- blog ---- */
.cat-chips { display: flex; gap: 9px; flex-wrap: wrap; margin: 0 0 26px; }
.cat-chips button { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-dim); border-radius: 999px; padding: 7px 17px; font-size: 13.5px; cursor: pointer; font-family: var(--sans); transition: 0.2s; }
.cat-chips button:hover { color: var(--text); border-color: var(--text-faint); }
.cat-chips button.active { background: var(--accent); border-color: var(--accent); color: #08122b; font-weight: 700; }
.blog-item { display: block; color: var(--text); transition: transform 0.2s, border-color 0.2s; }
.blog-item:hover { transform: translateY(-4px); border-color: var(--accent); opacity: 1; }
.blog-title { font-family: var(--display); font-size: 19px; font-weight: 700; }
.blog-meta { color: var(--text-faint); font-size: 13px; font-family: var(--mono); margin: 5px 0; }
.blog-meta .cat { color: var(--accent2); }
.blog-excerpt { color: var(--text-dim); font-size: 15px; }

/* ---- article ---- */
article.post { line-height: 1.95; font-size: 16.5px; max-width: 780px; }
article.post h1 { font-family: var(--display); font-size: clamp(30px, 5vw, 46px); font-weight: 700; letter-spacing: -0.02em; margin: 0.3em 0 0.6em; line-height: 1.15; }
article.post h2 { font-family: var(--display); font-size: 26px; font-weight: 700; margin-top: 1.8em; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
article.post h3 { font-family: var(--display); font-size: 20px; font-weight: 700; }
article.post p { margin: 1.1em 0; }
article.post a { text-decoration: underline; text-underline-offset: 3px; }
article.post pre { background: #05070a; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14px; }
article.post code { font-family: var(--mono); background: var(--bg-elev2); padding: 2px 6px; border-radius: 6px; font-size: 0.88em; }
article.post pre code { background: none; padding: 0; }
article.post blockquote { border-left: 3px solid var(--accent); margin: 1.3em 0; padding: 6px 0 6px 18px; color: var(--text-dim); }
article.post img { border-radius: 12px; }
article.post video { width: 100%; border-radius: 12px; background: #000; }
article.post audio { width: 100%; margin: 10px 0; }
article.post .video-embed { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; margin: 1.4em 0; background: #000; }
article.post .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
article.post .mermaid { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 1.4em 0; text-align: center; overflow-x: auto; }

/* ---- links ---- */
.link-group h3 { font-family: var(--display); font-size: 17px; font-weight: 700; margin: 30px 0 8px; }
.link-row { padding: 13px 2px; border-bottom: 1px solid var(--border); font-size: 15.5px; }
.link-row:last-child { border-bottom: none; }

/* ---- states / footer ---- */
.loading, .empty { color: var(--text-faint); font-size: 15px; padding: 12px 0; }
.muted { color: var(--text-dim); }
footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 60px 0 50px; }
footer .foot-name { font-family: var(--display); font-size: clamp(28px, 6vw, 56px); font-weight: 700; letter-spacing: -0.02em; }
footer .foot-meta { color: var(--text-faint); font-size: 13.5px; font-family: var(--mono); margin-top: 18px; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; background: transparent; border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 0 auto; transition: 0.25s; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-links {
    position: fixed; top: 68px; left: 0; right: 0; z-index: 49; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
    padding: 8px 20px 16px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: 0.25s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 8px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 32px; }
}
