/* ============================================================
   koshoutou · Portfolio — Black & White Minimalist
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-card: #f7f7f7;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --ink-3: #6b6b6b;
  --ink-4: #9a9a9a;
  --line: #e5e5e5;
  --line-2: #d4d4d4;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", "Songti SC", serif;
  --max: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== PAGE WRAP (sticky footer support) ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HERO ===== */
.hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(0,0,0,0.03) 0%, transparent 60%),
    var(--bg);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 7rem 2rem 6rem;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--ink-4);
  margin-bottom: 1.75rem;
}
.hero-name {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1rem;
}
.hero-sub {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin-bottom: 2rem;
}
.hero-intro {
  max-width: 46rem;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin-bottom: 2.5rem;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}
.link-mono {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.link-mono:hover { color: var(--ink-3); border-color: var(--ink-3); }
.link-mono .arrow { transition: transform .2s; }
.link-mono:hover .arrow { transform: translateX(3px); }

/* ===== SECTIONS ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 5.5rem 2rem;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
  flex-wrap: wrap;
}
.section-no {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}
.section-title {
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
}
.section-note {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--ink-3);
  max-width: 28rem;
  text-align: right;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.about-card {
  background: var(--bg);
  padding: 2.25rem 2rem;
  transition: background .25s;
}
.about-card:hover { background: var(--bg-soft); }
.card-h {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--ink);
  font-family: var(--mono);
}
.about-card p { color: var(--ink-2); font-size: 0.97rem; }

/* ===== PROJECT LIST ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Project card — horizontal split */
.project {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .25s, box-shadow .25s;
  overflow: hidden;
}
.project:hover {
  border-color: var(--ink);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -32px rgba(0,0,0,0.25);
}
.project-info {
  padding: 2.5rem 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.project-visual {
  position: relative;
  background: var(--bg-soft);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.project-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}
.project-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 3px 8px;
}
.project-name {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.project-name .en {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.55em;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  margin-left: 0.6rem;
  vertical-align: middle;
}
.project-tagline {
  font-size: 1.05rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.project-desc {
  color: var(--ink-2);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.project-highlights {
  list-style: none;
  margin-bottom: 1.5rem;
}
.project-highlights li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}
.project-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--ink);
  font-family: var(--mono);
}
.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  background: var(--bg);
  letter-spacing: 0.02em;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}
.btn {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Visual panel */
.visual-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.visual-thumb {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.visual-thumb:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -28px rgba(0,0,0,0.4); }
.visual-thumb img { width: 100%; display: block; }
.visual-thumb .zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 4px 8px;
  pointer-events: none;
}
/* Demo visual (Food_diary) — styled placeholder card */
.demo-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  padding: 1.5rem;
  text-align: center;
}
.demo-card .demo-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.demo-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.demo-card p {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-bottom: 1rem;
  font-family: var(--mono);
}
.demo-card .demo-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  border-top: 1px dashed var(--line-2);
  padding-top: 0.75rem;
  word-break: break-all;
}

/* ===== STACK & DEPLOY ===== */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stack-col {
  background: var(--bg);
  padding: 2.25rem 2rem;
}
.stack-list { display: flex; flex-direction: column; gap: 1rem; }
.stack-list div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--line);
}
.stack-list div:last-child { border-bottom: none; padding-bottom: 0; }
.stack-list dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.stack-list dd { font-size: 0.93rem; color: var(--ink-2); }

.deploy-steps { list-style: none; counter-reset: none; display: flex; flex-direction: column; gap: 0.9rem; }
.deploy-steps li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.85rem;
  align-items: start;
  font-size: 0.93rem;
  color: var(--ink-2);
}
.step-no {
  font-family: var(--mono);
  font-size: 0.75rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  color: var(--ink);
}
code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.stack-note { margin-top: 1.25rem; font-size: 0.85rem; color: var(--ink-3); }
.deploy-steps { overflow-x: auto; }

/* ===== FOOTER (sticky) ===== */
.footer {
  margin-top: auto;
  background: var(--ink);
  color: #e8e8e8;
  padding: 3rem 2rem 1.75rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.footer-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.3rem; }
.footer-meta { font-size: 0.85rem; color: #a0a0a0; }
.footer-right { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer-right a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #e8e8e8;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.footer-right a:hover { color: #fff; border-color: #fff; }
.footer-copy {
  max-width: var(--max);
  margin: 1.25rem auto 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #7a7a7a;
  letter-spacing: 0.04em;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  cursor: pointer;
  animation: fade .25s ease;
}
.modal-panel {
  position: relative;
  background: var(--bg);
  max-width: 1000px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--ink);
  animation: pop .28s cubic-bezier(.2,.7,.3,1);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
  z-index: 2;
}
.modal-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.modal-head { padding: 2rem 2rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ink-4);
  margin-bottom: 0.6rem;
}
.modal-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.modal-desc { font-size: 0.9rem; color: var(--ink-3); }
.modal-body { background: var(--bg-soft); padding: 1.5rem; }
.modal-body img { width: 100%; border: 1px solid var(--line); }
.modal-foot {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .hero-inner { padding: 5rem 1.5rem 4rem; }
  .section { padding: 4rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .section-note { text-align: left; margin-left: 0; width: 100%; }

  .project { grid-template-columns: 1fr; }
  .project-info {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 2rem 1.5rem;
  }
  .project-visual { min-height: 240px; }

  /* full-width tappable buttons on mobile */
  .project-actions { flex-direction: column; }
  .project-actions .btn { width: 100%; justify-content: center; }
  .project-actions .btn .arrow { margin-left: auto; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero-name { font-size: 2.6rem; }
  .hero-links { gap: 1rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-right { gap: 1rem; }
  .stack-list div { grid-template-columns: 4.5rem 1fr; gap: 0.6rem; }
  .modal-head, .modal-foot { padding: 1.25rem; }
  .modal-body { padding: 1rem; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #c4c4c4; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ===== FADE-IN ON SCROLL (safe: visible by default) ===== */
.reveal { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
/* .in is added by JS when scrolled into view; harmless if it never fires */
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}
