/* =========================================================
   CRYSTAL NEON — base stylesheet
   Direction: technical HUD. IBM Plex superfamily (Mono for
   latin labels, Sans JP for body/headings), near-black base,
   cyan reserved as a scarce accent, faceted cut-corner motif.
   ========================================================= */

:root {
  --bg: #050a0e;
  --bg-raised: #0a1218;
  --line: rgba(158, 199, 212, 0.16);
  --line-strong: rgba(158, 199, 212, 0.34);
  --cyan: #00eaff;
  --cyan-soft: #7df3ff;
  --cyan-deep: #0e8b9c;
  --ink: #e6f2f5;
  --ink-dim: #9db4bc;
  --ink-faint: #627982;

  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --font-sans: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;

  /* signature: faceted cut corner */
  --bevel: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  --bevel-lg: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--cyan);
  color: #02171b;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  margin: 0;
}

p { margin: 0; color: var(--ink-dim); }

main, header, footer { position: relative; z-index: 1; }

/* =========================
   Header / Nav
   ========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem);
  background: rgba(5, 10, 14, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.logo span { color: var(--cyan); }

.nav {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.4rem);
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.nav a:hover {
  color: var(--cyan-soft);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* =========================
   Hero
   ========================= */
.hero {
  min-height: 100vh;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3rem;
  padding: 8rem clamp(1.5rem, 6vw, 4rem) 5rem;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  margin-bottom: 1.8rem;
}

.hero-title {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.hero-title span { display: block; }

.hero-lead {
  margin-top: 2rem;
  max-width: 36em;
  font-size: 1rem;
}

.hero-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  justify-self: end;
  width: min(32vw, 340px);
  pointer-events: none;
}
.hero-visual svg { width: 100%; height: auto; display: block; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.95rem 2rem;
  border: 1px solid transparent;
  display: inline-block;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--cyan);
  color: #02171b;
  clip-path: var(--bevel);
}
.btn-primary:hover { background: var(--cyan-soft); }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan-soft);
}
.btn-large {
  padding: 1.05rem 2.6rem;
  font-size: 0.9rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: clamp(1.5rem, 6vw, 4rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
}
.scroll-hint span {
  width: 40px;
  height: 1px;
  background: var(--ink-faint);
}

/* hero entrance — the page's one orchestrated motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero .eyebrow       { animation: rise 0.7s var(--ease) 0.05s both; }
.hero .hero-title    { animation: rise 0.7s var(--ease) 0.12s both; }
.hero .hero-lead     { animation: rise 0.7s var(--ease) 0.2s both; }
.hero .hero-actions  { animation: rise 0.7s var(--ease) 0.28s both; }
.hero .hero-visual   { animation: rise 0.9s var(--ease) 0.25s both; }

/* =========================
   Section shared
   ========================= */
section {
  padding: 6.5rem clamp(1.5rem, 6vw, 4rem);
  max-width: 1160px;
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 3.4rem;
}
.section-title span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--cyan);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: translateY(-0.3em);
}

/* =========================
   Concept (About)
   ========================= */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  row-gap: 3.5rem;
}

.concept-card {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.6rem;
}
.concept-card:nth-child(1) { grid-column: 1 / 6; }
.concept-card:nth-child(2) { grid-column: 7 / 12; margin-top: 4.5rem; }
.concept-card:nth-child(3) { grid-column: 4 / 9; }

.concept-icon {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--cyan);
  /* keep glyphs monochrome so emoji-capable ones follow the palette */
  font-variant-emoji: text;
  line-height: 1;
  margin-bottom: 1.1rem;
}
.concept-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  color: var(--ink);
}
.concept-card p {
  font-size: 0.92rem;
}

/* =========================
   Facets (Stack list)
   ========================= */
.facet-list {
  display: flex;
  flex-direction: column;
}
.facet-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  padding: 2.4rem 0;
  border-top: 1px solid var(--line);
}
.facet-item:last-child { border-bottom: 1px solid var(--line); }

.facet-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan-deep);
  padding-top: 0.35rem;
}
.facet-body h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.facet-body p {
  font-size: 0.92rem;
  max-width: 52em;
}

/* =========================
   Works
   ========================= */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3rem 2rem;
}
.work-card {
  display: block;
}
.work-thumb {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  clip-path: var(--bevel-lg);
  position: relative;
  /* faceted crystal surface: hard-stop planes in the card's hue */
  background:
    linear-gradient(118deg, hsl(var(--hue, 190) 50% 12% / 0.9) 0 34%, transparent 34%),
    linear-gradient(-62deg, hsl(var(--hue, 190) 55% 16% / 0.8) 0 26%, transparent 26%),
    hsl(var(--hue, 190) 45% 7%);
  transition: border-color 0.25s var(--ease);
}
.work-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  /* facet edge highlights along the plane breaks */
  background:
    linear-gradient(118deg, transparent calc(34% - 1px), hsl(var(--hue, 190) 85% 70% / 0.55) calc(34% - 1px) 34%, transparent 34%),
    linear-gradient(-62deg, transparent calc(26% - 1px), hsl(var(--hue, 190) 85% 70% / 0.4) calc(26% - 1px) 26%, transparent 26%);
  opacity: 0.45;
  transition: opacity 0.25s var(--ease);
}
.work-card:hover .work-thumb,
.work-card:focus-visible .work-thumb {
  border-color: var(--cyan-deep);
}
.work-card:hover .work-thumb::after,
.work-card:focus-visible .work-thumb::after {
  opacity: 1;
}
.work-card h3 {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.work-card:hover h3 { color: var(--cyan-soft); }
.work-card p {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* =========================
   Contact
   ========================= */
.contact-lead {
  font-size: 1rem;
  margin-bottom: 2.4rem;
}
.social-list {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2.6rem 0 0;
  padding: 0;
}
.social-list a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 0.55rem 1.2rem;
  display: inline-block;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.social-list a:hover {
  color: var(--cyan-soft);
  border-color: var(--cyan);
}

/* =========================
   Footer
   ========================= */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.4rem clamp(1.5rem, 6vw, 4rem) 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  max-width: 1160px;
  margin: 0 auto;
}
.site-footer p { color: var(--ink-faint); }
.to-top {
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  transition: color 0.2s var(--ease);
}
.to-top:hover { color: var(--cyan-soft); }

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    position: absolute;
    z-index: -1;
    right: -8%;
    top: 16%;
    width: min(58vw, 300px);
    opacity: 0.3;
  }
  .concept-card:nth-child(1),
  .concept-card:nth-child(2),
  .concept-card:nth-child(3) {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: #070d12;
    border-left: 1px solid var(--line);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 2.4rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav.is-open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .facet-item { grid-template-columns: 3rem 1fr; gap: 1rem; }
  .site-footer { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .eyebrow,
  .hero .hero-title,
  .hero .hero-lead,
  .hero .hero-actions,
  .hero .hero-visual {
    animation: none;
  }
}
