/* ============================================================
   AlgoNote株式会社 コーポレートサイト 共通スタイル
   - 依存ライブラリなし。色・フォントはここで一元管理。
   - 900px 未満でモバイルレイアウト(ハンバーガーメニュー)。
   ============================================================ */

:root {
  --g1: #1F2124;
  --g2: #232529;
  --g3: #26282B;
  --g4: #2B2D31;
  --g5: #2E3034;
  --g6: #35373B;
  --fg: #F2EDE1;
  --muted: #C7C3B8;
  --dim: #8A877E;
  --gold: #C6A15C;
  --blue: #7D95AF;
  --line: rgba(242, 237, 225, 0.08);
  --line-strong: rgba(242, 237, 225, 0.1);
  --sans: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1160px;
  --gutter: 32px;
  --header-h: 76px;
  --page-bg: var(--g4);
  --footer-bg: var(--g3);
}
body.home {
  --wrap: 1280px;
  --gutter: 40px;
  --header-h: 84px;
  --page-bg: var(--g2);
  --footer-bg: var(--g1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--fg); }
img, svg { max-width: 100%; height: auto; }
button { font-family: inherit; }
h1, h2, h3 { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* 日本語 / 英語 の切替(両方を DOM に持ち、html[data-lang] で表示を切替) */
.i18n-en { display: none; }
[data-lang="en"] .i18n-jp { display: none; }
[data-lang="en"] .i18n-en { display: revert; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 840px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.28em; color: var(--gold); }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--gold); color: #26282B; font-weight: 700; padding: 8px 14px; border-radius: 4px;
}
.skip-link:focus { left: 8px; }

/* ---------- header ----------
   背景と backdrop-filter は ::before に置く。要素自身に backdrop-filter を付けると
   中の fixed 配置(モバイルメニュー)の基準がヘッダーになってしまうため。 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(43, 45, 49, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.site-header--overlay { position: fixed; left: 0; right: 0; border-bottom: 0; }
.site-header--overlay::before {
  background: linear-gradient(rgba(35, 37, 41, 0.85), rgba(35, 37, 41, 0));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.site-header .wrap {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark { height: 34px; width: auto; display: block; }
.brand__word { height: 20px; width: auto; display: block; }
.home .site-header .brand__mark { height: 36px; }
.header-right { display: flex; align-items: center; gap: 32px; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.home .site-nav { gap: 34px; }
.site-nav a { font-size: 14px; font-weight: 500; color: var(--fg); white-space: nowrap; }
.home .site-nav a { font-size: 13.5px; letter-spacing: 0.04em; }
.site-nav a:hover { color: var(--gold); }
.site-nav a[aria-current="page"] { font-weight: 700; color: var(--gold); }
.lang-btn {
  background: none; border: 1px solid rgba(242, 237, 225, 0.25); color: var(--muted);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  padding: 6px 10px; border-radius: 4px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lang-btn:hover { border-color: var(--gold); color: var(--gold); }
.header-controls { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none; position: relative; width: 44px; height: 44px; margin-right: -8px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--fg);
  transition: transform .25s, opacity .25s, top .25s;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-size: 14px; font-weight: 700; text-align: center;
  padding: 14px 32px; border-radius: 4px;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn--primary { background: var(--gold); color: #26282B; }
.btn--primary:hover { background: var(--fg); color: #26282B; }
.btn--ghost { font-weight: 500; color: var(--fg); border: 1px solid rgba(242, 237, 225, 0.3); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- tags ---------- */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--blue);
  border: 1px solid rgba(125, 149, 175, 0.4); padding: 3px 9px; border-radius: 3px; white-space: nowrap;
}

/* ---------- home: hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 680px;
  overflow: hidden; background: var(--g2);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(35, 37, 41, 0.1) 0%, rgba(35, 37, 41, 0) 40%, rgba(35, 37, 41, 0.82) 88%, rgba(35, 37, 41, 0.95) 100%);
}
.hero__hud {
  position: absolute; top: 112px; right: 40px; text-align: right; pointer-events: none;
  font-family: var(--mono); font-size: 11px; line-height: 2; color: rgba(199, 195, 184, 0.65);
}
.hero__hud b { display: block; font-weight: 400; color: var(--gold); letter-spacing: 0.2em; }
.hero__body { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.hero__body .wrap { padding-bottom: 72px; pointer-events: auto; }
.hero__eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.32em; color: var(--gold); margin-bottom: 26px;
  animation: an-in .9s .1s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__title {
  margin: 0; font-size: clamp(44px, 6.4vw, 84px); line-height: 1.22; font-weight: 900; letter-spacing: 0.01em;
  animation: an-in .9s .22s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__title--brand img { display: block; width: min(640px, 72vw); height: auto; }
.hero__row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-top: 36px;
  animation: an-in .9s .34s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__lead { margin: 0; max-width: 820px; font-size: 15px; line-height: 2.1; color: var(--muted); text-wrap: pretty; }
.hero__cta { display: flex; gap: 14px; flex-shrink: 0; flex-wrap: wrap; }
.hero__cta .btn { padding: 15px 34px; border-radius: 3px; }

/* ---------- home: ticker ---------- */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--g3); }
.ticker__track {
  display: flex; gap: 56px; width: max-content; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--dim);
  animation: an-tick 46s linear infinite;
}
.ticker__track i { font-style: normal; color: var(--gold); }

/* ---------- home: sections ---------- */
.section { border-bottom: 1px solid var(--line); }
.section--deep { background: var(--g3); }
.section > .wrap { padding-block: 130px; }
.sec-head { display: flex; align-items: baseline; gap: 24px; margin-bottom: 64px; flex-wrap: wrap; }
.sec-head--tight { margin-bottom: 20px; }
.sec-head__num { font-family: var(--mono); font-size: 13px; color: var(--blue); }
.sec-head__title { margin: 0; font-size: clamp(30px, 3.4vw, 44px); font-weight: 900; }
.sec-head__tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; color: var(--gold); }

.svc-list { display: flex; flex-direction: column; gap: 16px; }
.svc-row {
  background: var(--g4); border: 1px solid var(--line); border-radius: 6px; padding: 38px 40px;
  display: grid; grid-template-columns: 64px 1fr 200px; gap: 28px; align-items: center;
  transition: border-color .3s, transform .3s;
}
.svc-row:hover { border-color: rgba(198, 161, 92, 0.55); transform: translateY(-2px); }
.svc-row__idx { font-family: var(--mono); font-size: 15px; color: var(--blue); }
.svc-row h3 { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
.svc-row p { margin: 0; font-size: 14px; line-height: 1.95; color: var(--muted); max-width: 620px; }
.viz {
  width: 200px; height: 112px; justify-self: end; display: block;
  border: 1px solid rgba(242, 237, 225, 0.07); border-radius: 4px; background: var(--g3);
}

.case-note { margin: 0 0 48px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.case-list { display: flex; flex-direction: column; }
.case {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: baseline;
  padding: 34px 12px; border-top: 1px solid var(--line-strong);
}
.case:last-child { border-bottom: 1px solid var(--line-strong); }
.case h3 { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.5; }
.case p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--muted); max-width: 640px; }

.news > .wrap { padding-block: 110px; display: grid; grid-template-columns: 300px 1fr; gap: 48px; }
.news .sec-head { margin-bottom: 0; }
.news .sec-head__title { font-size: clamp(28px, 3vw, 38px); }
.news-list { display: flex; flex-direction: column; }
.news-item { display: flex; gap: 32px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.news-item time { font-family: var(--mono); font-size: 13px; color: var(--blue); flex-shrink: 0; }
.news-item span { font-size: 15px; }

/* ---------- sub pages ---------- */
.page-hero { border-bottom: 1px solid var(--line); }
.page-hero > .wrap { padding-block: 90px 70px; }
.page-hero .eyebrow { margin-bottom: 20px; }
.page-hero h1 { margin: 0; font-size: 42px; font-weight: 700; }
.page-hero p { margin: 24px 0 0; max-width: 680px; font-size: 15px; line-height: 2; color: var(--muted); text-wrap: pretty; }
.sub-section { border-bottom: 1px solid var(--line); }
.sub-section--deep { background: var(--g3); }
.sub-section > .wrap { padding-block: 80px; }
.sub-section > .wrap--lg { padding-block: 90px; }
.h2 { margin: 0 0 32px; font-size: 32px; font-weight: 700; }
.h2--lg { margin-bottom: 48px; }
.h2--sm { margin-bottom: 28px; }

/* services */
.svc-cards { display: flex; flex-direction: column; gap: 24px; }
.svc-card {
  background: var(--g6); border: 1px solid var(--line); border-radius: 8px; padding: 44px 40px;
  display: grid; grid-template-columns: 80px 1fr 200px; gap: 24px;
}
.svc-card .viz { align-self: center; }
.svc-card__idx { font-family: var(--mono); font-size: 15px; color: var(--blue); }
.svc-card h2 { margin: 0 0 16px; font-size: 24px; font-weight: 700; }
.svc-card p { margin: 0 0 20px; font-size: 14.5px; line-height: 2; color: var(--muted); max-width: 720px; text-wrap: pretty; }
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step { border-top: 2px solid rgba(198, 161, 92, 0.45); padding-top: 20px; }
.step:first-child { border-top-color: var(--gold); }
.step__num { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-bottom: 10px; }
.step h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--muted); }

/* company */
.spec { margin: 0; display: flex; flex-direction: column; }
.spec__row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 13px; font-weight: 500; color: var(--gold); letter-spacing: 0.08em; }
.spec dd { margin: 0; font-size: 15px; line-height: 1.8; }
.spec dd.spec__list { line-height: 2; }
.story { display: flex; gap: 36px; align-items: flex-start; }
.story img { width: 96px; flex-shrink: 0; }
.story p { margin: 0; font-size: 15px; line-height: 2.2; color: var(--muted); text-wrap: pretty; }
.access-lines { margin: 0 0 24px; font-size: 15px; line-height: 2; color: var(--muted); }
.arrow-link { font-size: 13.5px; }

/* prose (privacy policy etc.) */
.prose { max-width: 760px; font-size: 15px; line-height: 2; color: var(--muted); }
.prose h2 { margin: 44px 0 12px; font-size: 20px; font-weight: 700; color: var(--fg); }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose .meta { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* 404 */
.notfound > .wrap { padding-block: 120px; text-align: center; }
.notfound__code { margin: 0; font-family: var(--mono); font-weight: 500; font-size: clamp(64px, 12vw, 120px); line-height: 1; color: var(--gold); }
.notfound h1 { margin: 24px 0 16px; font-size: 26px; font-weight: 700; }
.notfound p { margin: 0 0 36px; color: var(--muted); line-height: 2; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); }
.site-footer > .wrap { padding-block: 64px 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.site-footer .brand { margin-bottom: 20px; }
.site-footer .brand__mark { height: 28px; }
.site-footer .brand__word { height: 16px; }
.footer-addr { margin: 0; font-size: 13px; line-height: 1.9; color: var(--muted); }
.footer-nav { display: flex; flex-direction: column; gap: 12px; }
.footer-nav a { font-size: 13px; color: var(--muted); }
.footer-nav a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}

/* ---------- motion ---------- */
@keyframes an-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes an-tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__eyebrow, .hero__title, .hero__row, .ticker__track { animation: none; }
  .svc-row:hover, .btn:hover { transform: none; }
  .site-nav, .nav-toggle span, .btn, .lang-btn, .svc-row { transition: none; }
}

/* ============================================================
   モバイル / タブレット
   ============================================================ */
@media (max-width: 899px) {
  :root, body.home { --gutter: 20px; --header-h: 64px; }

  /* header: ハンバーガーメニュー */
  .site-header--overlay::before { background: linear-gradient(rgba(35, 37, 41, 0.92), rgba(35, 37, 41, 0.35)); }
  .brand__mark, .home .site-header .brand__mark { height: 30px; }
  .brand__word { height: 17px; }
  .header-right { gap: 8px; }
  .nav-toggle { display: block; }
  .site-nav, .home .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 1;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 40px; overflow-y: auto;
    background: rgba(35, 37, 41, 0.98);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s ease, visibility 0s .3s;
  }
  .site-nav.is-open { transform: none; visibility: visible; transition: transform .3s ease, visibility 0s 0s; }
  .site-nav a, .home .site-nav a { font-size: 18px; font-weight: 500; padding: 18px 4px; border-bottom: 1px solid var(--line); white-space: normal; }
  .site-header--overlay .site-nav { top: 0; padding-top: calc(var(--header-h) + 8px); }
  .brand, .header-controls { position: relative; z-index: 2; }

  /* hero */
  .hero { min-height: 640px; }
  .hero__hud { top: calc(var(--header-h) + 14px); right: var(--gutter); font-size: 10px; }
  .hero__body .wrap { padding-bottom: 48px; }
  .hero__eyebrow { font-size: 11px; letter-spacing: 0.26em; margin-bottom: 18px; }
  .hero__title { font-size: clamp(34px, 9vw, 52px); }
  .hero__title--brand img { width: min(420px, 82vw); }
  .hero__title--brand img { display: block; width: min(640px, 72vw); height: auto; }
.hero__row { margin-top: 26px; gap: 28px; }
  .hero__lead { font-size: 14.5px; line-height: 1.95; }
  .hero__lead br { display: none; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 160px; }

  /* sections */
  .section > .wrap { padding-block: 72px; }
  .sec-head { gap: 14px 18px; margin-bottom: 36px; }
  .sec-head--tight { margin-bottom: 16px; }
  .svc-row { grid-template-columns: 1fr; gap: 14px; padding: 26px 22px; }
  .svc-row h3 { font-size: 19px; }
  .viz { justify-self: start; }
  .case-note { margin-bottom: 28px; }
  .case { grid-template-columns: 1fr; gap: 14px; padding: 26px 4px; }
  .case h3 { font-size: 18px; }
  .news > .wrap { padding-block: 72px; grid-template-columns: 1fr; gap: 24px; }

  /* sub pages */
  .page-hero > .wrap { padding-block: 56px 44px; }
  .page-hero h1 { font-size: 32px; }
  .sub-section > .wrap, .sub-section > .wrap--lg { padding-block: 56px; }
  .h2 { font-size: 26px; margin-bottom: 24px; }
  .h2--lg { margin-bottom: 32px; }
  .svc-card { grid-template-columns: 1fr; gap: 12px; padding: 28px 22px; }
  .svc-card h2 { font-size: 20px; }
  .spec__row { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .story { flex-direction: column; gap: 20px; }
  .story img { width: 72px; }
  .notfound > .wrap { padding-block: 80px; }

  /* footer */
  .site-footer > .wrap { padding-block: 48px 32px; }
  .footer-top { flex-direction: column; gap: 32px; }
  .footer-nav { gap: 14px; }
  .footer-bottom { margin-top: 36px; }
}

@media (max-width: 480px) {
  .hero__hud { font-size: 9px; line-height: 1.9; }
  .hero__title { font-size: clamp(30px, 9.2vw, 40px); }
  .hero__cta .btn { flex-basis: 100%; }
  .ticker__track { font-size: 11px; gap: 40px; }
  .news-item { flex-direction: column; gap: 6px; }
  .page-hero h1 { font-size: 28px; }
}
