:root {
  --bg: #0f1419;
  --bg-soft: #1a2332;
  --surface: #ffffff;
  --text: #0f172a;
  --text-on-dark: #f1f5f9;
  --muted: #64748b;
  --muted-on-dark: #94a3b8;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --border: #e2e8f0;
  --radius: 14px;
  --font: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  line-height: 1.65;
}

.container {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #243044;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.logo {
  color: var(--text-on-dark);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.logo small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted-on-dark);
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover,
.nav a.is-active {
  color: #fff;
  background: rgba(245, 158, 11, 0.15);
}

.nav-cta {
  background: var(--accent) !important;
  color: #111 !important;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: #e2e8f0;
}

.hero {
  background: linear-gradient(160deg, #0f1419 0%, #1a2332 55%, #2a2010 100%);
  color: var(--text-on-dark);
  padding: 72px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
}

.hero-accent {
  color: var(--accent);
}

.lead {
  color: var(--muted-on-dark);
  font-size: 1.05rem;
  margin: 0 0 28px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 24px;
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.hero-card p {
  margin: 0;
  color: var(--muted-on-dark);
  font-size: 0.92rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #111;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text-on-dark);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section {
  padding: 56px 0;
}

.section-dark {
  background: #f8fafc;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.section-lead {
  margin: 0 0 32px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.card a {
  color: var(--accent-hover);
  font-weight: 700;
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-draft {
  background: #e2e8f0;
  color: #475569;
}

.badge-live {
  background: #dcfce7;
  color: #166534;
}

.badge-beta {
  background: #dbeafe;
  color: #1e40af;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: #fff;
}

.project-row h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.project-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.project-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.project-detail-hero {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .project-row {
    grid-template-columns: 1fr;
  }
}

.page-main {
  padding: 48px 0 64px;
}

.page-main h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.page-intro {
  color: var(--muted);
  margin: 0 0 32px;
}

.prose h2 {
  margin: 32px 0 12px;
  font-size: 1.15rem;
}

.prose p,
.prose li,
.prose dl {
  color: #334155;
}

.prose dt {
  font-weight: 700;
  margin-top: 16px;
}

.prose dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 16px;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  color: #78350f;
  font-size: 0.92rem;
}

.info-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 0.92rem;
}

.site-footer {
  background: var(--bg);
  color: var(--muted-on-dark);
  padding: 40px 0 32px;
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-brand {
  margin: 0;
  line-height: 1.6;
  color: #e2e8f0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 0.82rem;
}

/* Tech background page */
.tech-page .tech-hero {
  position: relative;
  padding: 72px 0 64px;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.92) 0%, rgba(241, 245, 249, 0.88) 55%, rgba(254, 243, 199, 0.35) 100%),
    url("/assets/tech-hero-bg.png") center / cover no-repeat;
  border-bottom: 1px solid var(--border);
}

.tech-hero-inner {
  max-width: 720px;
}

.tech-hero .lead {
  color: #475569;
  margin-bottom: 24px;
}

.tech-stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tag {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.tech-specialty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.tech-specialty-card {
  background: #fff;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
}

.tech-specialty-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #b45309;
}

.tech-specialty-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.tech-principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.tech-principle-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.tech-principle-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #0f172a;
}

.tech-principle-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.tech-layer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.tech-layer {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.tech-layer h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #b45309;
}

.tech-layer ul {
  margin: 0;
  padding-left: 1.2em;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .tech-specialty-grid,
  .tech-principles,
  .tech-layer-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #0f1419;
    padding: 12px 16px 16px;
    border-bottom: 1px solid #243044;
  }

  .nav.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }
}
