/* ==========================================================================
   Gecko Studios Ltd. — styles
   色・余白・書体はすべて :root のトークンで管理する。
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: dark (default) ---------- */
:root {
  --bg: #0b1020;
  --bg-sub: #111827;
  --bg-raised: #141c2e;
  --text: #f8fafc;
  --text-sub: #94a3b8;
  --text-faint: #8391a7;
  --accent: #38bdf8;
  --accent-strong: #7dd3fc;
  --accent-soft: rgb(56 189 248 / 0.1);
  --border: #263244;
  --border-soft: #1b2436;
  --header-bg: rgb(11 16 32 / 0.78);
  --button-text: #0b1020;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(80px, 11vw, 144px);
  --radius: 14px;
  --header-h: 64px;

  color-scheme: dark;
}

/* ---------- Tokens: light ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-sub: #f6f8fb;
    --bg-raised: #ffffff;
    --text: #0b1020;
    --text-sub: #475569;
    --text-faint: #5b6b80;
    --accent: #0369a1;
    --accent-strong: #075985;
    --accent-soft: rgb(3 105 161 / 0.07);
    --border: #dfe5ee;
    --border-soft: #edf1f6;
    --header-bg: rgb(255 255 255 / 0.82);
    --button-text: #ffffff;

    color-scheme: light;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--button-text);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.muted {
  color: var(--text-sub);
}

.section-intro,
.lead {
  color: var(--text-sub);
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.65;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button-primary {
  background: var(--accent);
  color: var(--button-text);
}

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

.button-secondary {
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--text-faint);
  background: var(--accent-soft);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-soft);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  flex: none;
  color: var(--accent);
}

/* Mobile: popover menu */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before {
  display: block;
  width: 20px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}

.nav-toggle-icon {
  position: relative;
  top: -3px;
}

.nav-toggle-icon::before {
  content: "";
  position: relative;
  top: 6px;
}

.site-nav {
  position: fixed;
  inset: calc(var(--header-h) + 8px) var(--gutter) auto;
  width: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.45);
}

.site-nav::backdrop {
  background: rgb(0 0 0 / 0.35);
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
}

.site-nav a:hover {
  background: var(--accent-soft);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  /* Desktop: 常に表示されるインラインナビ */
  .site-nav,
  .site-nav:not(:popover-open) {
    position: static;
    display: block;
    inset: auto;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .site-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .site-nav a {
    min-height: 40px;
    padding: 0 12px;
    color: var(--text-sub);
    font-size: 0.9375rem;
    transition: color 0.2s ease;
  }

  .site-nav a:hover {
    background: none;
    color: var(--text);
  }

  .site-nav .nav-cta {
    margin-left: 8px;
    border: 1px solid var(--border);
    color: var(--text);
  }

  .site-nav .nav-cta:hover {
    border-color: var(--text-faint);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 120px) clamp(72px, 10vw, 136px);
  border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  margin-bottom: 28px;
  font-size: clamp(2.375rem, 6.4vw, 4.25rem);
  font-weight: 620;
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero h1 .muted {
  display: block;
}

.hero .lead {
  max-width: 36rem;
  margin-bottom: 40px;
}

.hero-visual {
  justify-self: center;
  width: min(100%, 440px);
}

.hero-visual svg {
  width: 100%;
  height: auto;
}

.hv-grid path {
  stroke: var(--border);
  stroke-width: 1;
}

.hv-rings circle {
  stroke: var(--accent);
  stroke-opacity: 0.22;
}

.hv-rings .hv-ring-strong {
  stroke-opacity: 0.45;
}

.hv-ticks path {
  stroke: var(--text-faint);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.hv-orbit {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 60 882.5;
  transform-origin: 240px 240px;
}

.hv-pupil {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.hv-nodes circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
}

@media (min-width: 640px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
  }

  .hero-visual {
    justify-self: end;
    width: min(100%, 400px);
  }
}

/* 小さい画面では装飾グラフィックを出さず、本文と CTA を優先する */
@media (max-width: 639px) {
  .hero-visual {
    display: none;
  }
}

@media (max-width: 479px) {
  .actions .button {
    flex: 1 1 100%;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-space);
}

.section-alt {
  border-block: 1px solid var(--border-soft);
  background: var(--bg-sub);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head h2 {
  margin-bottom: 20px;
}

.section-head h2:last-child {
  margin-bottom: 0;
}

/* ---------- Services ---------- */
.service-grid {
  display: grid;
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sub);
  transition: border-color 0.25s ease;
}

.card:hover {
  border-color: var(--text-faint);
}

.card-index,
.step-num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.card-index {
  margin-bottom: 40px;
}

.card h3 {
  margin-bottom: 12px;
}

.card > p:not(.card-index) {
  margin-bottom: 28px;
  color: var(--text-sub);
  font-size: 0.9688rem;
}

.checklist {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.checklist li {
  position: relative;
  padding: 5px 0 5px 22px;
  font-size: 0.9375rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

@media (min-width: 720px) and (max-width: 1019px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid .card:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1020px) {
  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 48px;
}

.about-grid h2 {
  margin-bottom: 28px;
}

.prose {
  display: grid;
  gap: 18px;
  max-width: 40rem;
  color: var(--text-sub);
  font-size: 1.0625rem;
}

.prose p:first-child {
  color: var(--text);
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  line-height: 1.55;
}

.facts {
  align-self: end;
  border-top: 1px solid var(--border);
}

.facts div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.8fr) 1.2fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.facts dt {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.9;
}

.facts dd {
  font-weight: 500;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(48px, 8vw, 112px);
  }
}

/* ---------- Approach ---------- */
.steps {
  display: grid;
  gap: 0;
  counter-reset: none;
}

.step {
  position: relative;
  padding: 0 0 36px 32px;
  border-left: 1px solid var(--border);
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.step-num {
  margin-bottom: 10px;
}

.step h3 {
  margin-bottom: 10px;
}

.step p:not(.step-num) {
  color: var(--text-sub);
  font-size: 0.9688rem;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 32px;
  }

  .step,
  .step:last-child {
    padding: 28px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .step::before {
    top: -5px;
    left: 0;
  }
}

@media (min-width: 1020px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
  }

  .step p:not(.step-num) {
    padding-right: 8px;
  }
}

/* ---------- Contact ---------- */
.contact {
  padding-top: 0;
}

.contact-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--bg-sub);
}

.contact-panel h2 {
  max-width: 16ch;
  margin-bottom: 20px;
}

.contact-panel .section-intro {
  max-width: 40rem;
  margin-bottom: 36px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 5px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.contact-email:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 56px 40px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-sub);
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  gap: 32px;
}

.footer-company {
  display: grid;
  gap: 6px;
}

.footer-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-copy {
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 0.8125rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-copy {
    grid-column: 1 / -1;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hv-orbit {
    animation: orbit 28s linear infinite;
  }

  .hero-copy > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero-copy > :nth-child(4) {
    animation-delay: 0.18s;
  }

  .hero-visual {
    animation: fade 1.2s ease 0.15s both;
  }
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ---------- 404 ---------- */
.not-found {
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
}

.not-found .brand {
  margin-bottom: clamp(48px, 10vw, 96px);
}

.not-found h1 {
  margin-bottom: 20px;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.not-found .lead {
  max-width: 32rem;
  margin-bottom: 36px;
}
