/* ============================================================
   MACHIKANE BASE — Enterprise Design System
   ============================================================ */

:root {
  /* Design Language Palette */
  --blue-90: #001d6c;
  --blue-80: #002d9c;
  --blue-70: #0043ce;
  --blue-60: #0f62fe;
  --blue-50: #4589ff;
  --blue-20: #d0e2ff;
  --blue-10: #edf5ff;

  --gray-100: #161616;
  --gray-90: #262626;
  --gray-80: #393939;
  --gray-70: #525252;
  --gray-60: #6f6f6f;
  --gray-50: #8d8d8d;
  --gray-30: #c6c6c6;
  --gray-20: #e0e0e0;
  --gray-10: #f4f4f4;

  --red-50: #e2231a;
  --white: #ffffff;

  /* Type scale */
  --type-display: clamp(3rem, 5vw, 4.5rem);
  --type-heading-01: 2.25rem;
  --type-heading-02: 1.75rem;
  --type-body: 1rem;
  --type-label: 0.8rem;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans JP', "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  color: var(--gray-100);
  background-color: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============================================================
   GRID & LAYOUT
   ============================================================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 5%);
}
.container-medium {
  max-width: 960px;
  margin: 0 auto;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-60);
}
.eyebrow.on-dark { color: var(--blue-50); }

.text-gray { color: var(--gray-70); }
.text-sm   { font-size: 0.85rem; }

/* ============================================================
   UTILITY BAR (ThinkPad Red Accent)
   ============================================================ */

.utility-bar {
  background-color: var(--gray-100);
  border-top: 3px solid var(--red-50);
  color: var(--gray-30);
  padding: 0.4rem 0;
  font-size: 0.8rem;
}

/* ============================================================
   HEADER (Minimal, Enterprise)
   ============================================================ */

.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-20);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.logo-text {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 202;
}
.nav {
  display: flex;
  gap: 0;
  height: 100%;
}
.nav a {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-80);
  border-left: 1px solid var(--gray-20);
  transition: background 0.15s, color 0.15s;
}
.nav a:last-child {
  border-right: 1px solid var(--gray-20);
}
.nav a:hover,
.nav a.active {
  background-color: var(--gray-10);
  color: var(--blue-60);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 202;
}
.hamburger, .hamburger::before, .hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--gray-100);
  position: absolute;
  left: 8px;
  transition: transform 0.3s, background-color 0.3s, top 0.3s;
}
.hamburger { top: 19px; }
.hamburger::before, .hamburger::after { content: ''; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

body.menu-open .hamburger { background-color: transparent; }
body.menu-open .hamburger::before { top: 0; transform: rotate(45deg); background-color: var(--gray-100); }
body.menu-open .hamburger::after { top: 0; transform: rotate(-45deg); background-color: var(--gray-100); }

/* ============================================================
   HERO — Full-bleed dark dramatic hero
   ============================================================ */

.hero {
  background-color: var(--gray-100);
  color: var(--white);
  padding: 7rem 0 6rem;
  position: relative;
  overflow: hidden;
}
/* Subtle grid background */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
/* Accent glow */
.hero::after {
  content: '';
  position: absolute;
  top: -30%; right: -10%;
  width: 60%; height: 120%;
  background: radial-gradient(ellipse, rgba(15,98,254,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-headline {
  font-size: var(--type-display);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
}
.hero-headline strong {
  font-weight: 600;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--gray-30);
  margin-bottom: 3rem;
  max-width: 540px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   HERO VISUAL — Abstract schematic
   ============================================================ */

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.schematic {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
/* Horizontal scanlines */
.schematic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 79px, rgba(255,255,255,0.04) 80px
  );
}
/* Blue glow block */
.sch-block {
  position: absolute;
  transition: opacity 0.6s;
}
.sch-blue {
  bottom: 0; right: 0;
  width: 55%; height: 55%;
  background: linear-gradient(135deg, var(--blue-80), var(--blue-60));
  opacity: 0.15;
}
.sch-dot {
  bottom: 0; right: 0;
  width: 55%; height: 55%;
  background-image: radial-gradient(rgba(255,255,255,0.25) 1px, transparent 1px);
  background-size: 16px 16px;
}
.sch-accent {
  bottom: 0; left: 20%;
  width: 12%; height: 4px;
  background-color: var(--red-50);
}
.sch-line-h {
  top: 40%; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.sch-line-v {
  top: 0; left: 60%;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.1), transparent);
}
.sch-label {
  position: absolute;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.1em;
}
.sch-label-1 { top: 38%; right: 8%; }
.sch-label-2 { bottom: 10%; left: 8%; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 2rem;
  font-family: 'IBM Plex Sans JP', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.btn-primary {
  background-color: var(--blue-60);
  color: var(--white);
}
.btn-primary:hover {
  background-color: var(--blue-70);
}
.btn-ghost {
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  background: transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline-dark {
  border: 1px solid var(--blue-60);
  color: var(--blue-60);
  background: transparent;
}
.btn-outline-dark:hover {
  background: var(--blue-60);
  color: var(--white);
}
.btn span {
  margin-left: 0.5rem;
}

/* Link with arrow */
.link-with-arrow {
  color: var(--blue-60);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  transition: gap 0.15s;
}
.link-with-arrow:hover {
  gap: 0.7rem;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  padding: 6rem 0;
}
.section-header {
  margin-bottom: 3rem;
}
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-title {
  font-size: var(--type-heading-01);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.bg-light  { background-color: var(--gray-10); }
.bg-dark   { background-color: var(--gray-100); color: var(--white); }
.bg-blue   { background-color: var(--blue-90); color: var(--white); }
.border-bottom { border-bottom: 1px solid var(--gray-20); }

/* ============================================================
   NEWS LIST
   ============================================================ */

.news-list {
  border-top: 2px solid var(--gray-100);
}
.news-item {
  display: grid;
  grid-template-columns: 110px 70px 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0.5rem;
  border-bottom: 1px solid var(--gray-20);
  color: var(--gray-100);
  transition: background-color 0.1s;
}
.news-item:hover {
  background-color: var(--blue-10);
}
.news-date {
  color: var(--gray-60);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}
.news-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  text-align: center;
  white-space: nowrap;
}
.tag-press {
  background-color: var(--blue-60);
  color: var(--white);
}
.tag-update {
  background-color: transparent;
  color: var(--gray-80);
  border: 1px solid var(--gray-30);
}
.news-title-text {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ============================================================
   SERVICE ROWS
   ============================================================ */

.service-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 3rem 0;
  gap: 2rem;
}
.service-row:first-child {
  border-top: 2px solid var(--gray-100);
}
.service-meta {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--blue-60);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
}
.service-name {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.service-desc {
  color: var(--gray-80);
  font-size: 1rem;
  line-height: 1.8;
}

/* ============================================================
   CASE STUDIES — INDEX CARDS
   ============================================================ */

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2px;
}
.case-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-20);
  transition: box-shadow 0.2s, transform 0.2s;
  color: var(--gray-100);
}
.case-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.case-thumb {
  height: 180px;
  background-color: var(--gray-10);
  border-bottom: 1px solid var(--gray-20);
  position: relative;
  overflow: hidden;
}
.case-thumb-blue {
  background: linear-gradient(135deg, var(--blue-10), rgba(15,98,254,0.08));
}
/* Decorative grid on thumb */
.case-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--gray-20) 1px, transparent 1px),
    linear-gradient(90deg, var(--gray-20) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
}
.case-label {
  position: absolute;
  top: 1rem; left: 1rem;
  background-color: var(--gray-100);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1;
}
.case-body {
  padding: 2rem;
  flex-grow: 1;
}
.case-company {
  font-size: 0.8rem;
  color: var(--gray-60);
  margin-bottom: 0.5rem;
}
.case-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
}

/* ============================================================
   CASE DETAIL (cases.html)
   ============================================================ */

.case-detail {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--gray-20);
}
.case-detail:last-child { border-bottom: none; }
.case-detail-label {
  display: inline-block;
  background: var(--gray-100);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.case-detail-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2rem;
}
.case-detail-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
}
.case-detail-main h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue-60);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--blue-20);
}
.case-detail-main h4:first-child { margin-top: 0; }
.case-detail-main p { color: var(--gray-80); line-height: 1.8; }
.case-example-list {
  list-style: disc;
  margin-left: 1.5rem;
  color: var(--gray-80);
  line-height: 2;
}

.case-detail-sidebar {
  background: var(--gray-10);
  border-left: 3px solid var(--blue-60);
  padding: 2rem;
  align-self: start;
}
.sidebar-block { margin-bottom: 1.5rem; }
.sidebar-block:last-child { margin-bottom: 0; }
.sidebar-block h5 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray-60);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}
.sidebar-block p { font-weight: 500; font-size: 0.95rem; }

/* ============================================================
   FEATURE BLOCKS (services.html)
   ============================================================ */

.feature-block {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--gray-20);
}
.feature-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--blue-60);
  margin-bottom: 2rem;
  padding-left: 1.5rem;
  border-left: 4px solid var(--blue-60);
}
.feature-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
}
.feature-specs {
  background: var(--gray-10);
  border-left: 3px solid var(--blue-60);
  padding: 2rem;
  align-self: start;
}
.feature-specs h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.feature-specs ul {
  list-style: disc;
  margin-left: 1.5rem;
  color: var(--gray-80);
  line-height: 2;
}
.mt-2 { margin-top: 1rem; }

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline {
  position: relative;
  padding-left: 3rem;
  border-left: 2px solid var(--gray-20);
}
.timeline-item {
  position: relative;
  padding-bottom: 3rem;
  padding-left: 2rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -3.6rem;
  top: 0.2rem;
  width: 14px; height: 14px;
  background: var(--blue-60);
  border: 3px solid var(--gray-10);
  border-radius: 50%;
}
.timeline-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--blue-60);
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.timeline-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.timeline-content p {
  color: var(--gray-70);
  font-size: 0.95rem;
}

/* ============================================================
   CORPORATE TABLES
   ============================================================ */

.location-box {
  background: var(--white);
  border: 1px solid var(--gray-20);
  padding: 2.5rem 3rem;
}
.mt-3 { margin-top: 2rem; }
.box-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-60);
  border-left: 4px solid var(--blue-60);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}
.corp-table {
  border-top: 2px solid var(--gray-100);
}
.corp-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--gray-20);
  padding: 1.25rem 0;
  gap: 2rem;
}
.corp-th {
  font-weight: 600;
  color: var(--gray-80);
  font-size: 0.9rem;
}
.corp-td {
  color: var(--gray-100);
  line-height: 1.8;
}

/* ============================================================
   SUBPAGE HERO
   ============================================================ */

.page-hero {
  background-color: var(--gray-100);
  color: var(--white);
  padding: 5rem 0 4rem;
  border-bottom: 3px solid var(--blue-60);
  margin-bottom: 4rem;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
.page-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
}
.breadcrumb {
  font-size: 0.8rem;
  color: var(--gray-50);
  margin-bottom: 2rem;
  position: relative;
}
.breadcrumb a { color: var(--blue-50); }
.page-hero .hero-desc {
  color: var(--gray-30);
  position: relative;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background-color: var(--gray-100);
  color: var(--white);
  padding: 3rem 0;
  border-top: 3px solid var(--red-50);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy {
  color: var(--gray-60);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .hero-grid,
  .service-row,
  .flex-split,
  .corp-row,
  .feature-content,
  .case-detail-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-headline { font-size: 2.5rem; }
  .news-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .location-box { padding: 2rem; }
  .case-grid { grid-template-columns: 1fr; }

  /* Mobile Nav */
  .menu-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--white);
    flex-direction: column;
    padding: 0;
    border-top: 1px solid var(--gray-20);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    z-index: 201;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav a {
    justify-content: center;
    border-left: none;
    border-right: none !important;
    border-bottom: 1px solid var(--gray-20);
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
  }
}
