/* ==========================================================
   株式会社UNDERDOG
   白基調・余白を広くとった1ページ構成。
   色と文字の決まりは :root にまとめてある。
   ========================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f3;
  --ink: #111111;
  --ink-2: #3b3b3b;
  --muted: #76766f;
  --line: #e3e2dc;
  --accent: #2a44ff;

  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --font-en: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(96px, 14vw, 180px);
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .03em;
  font-feature-settings: "palt";
  /* 日本語を文節で折り返す（対応ブラウザーのみ） */
  word-break: auto-phrase;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

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

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

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

.br-pc { display: none; }
@media (min-width: 900px) { .br-pc { display: inline; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 52px;
  padding: 0 30px;
  font-family: var(--font-ja);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-text {
  border-color: transparent;
  padding: 0 4px;
  background: none;
  color: var(--ink);
}
.btn-text .arrow { transition: transform .3s var(--ease); }
.btn-text:hover { color: var(--accent); }
.btn-text:hover .arrow { transform: translateX(4px); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.header-logo img { width: 148px; }

.global-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}
.global-nav a {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
}
.global-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.global-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.global-nav .nav-cta a {
  padding: 9px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.global-nav .nav-cta a::after { display: none; }
.global-nav .nav-cta a:hover { background: var(--ink); color: #fff; }

.menu-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-toggle-bar {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.menu-toggle-bar:nth-child(1) { top: 18px; }
.menu-toggle-bar:nth-child(2) { top: 25px; }
.menu-open .menu-toggle-bar:nth-child(1) { top: 21.5px; transform: rotate(30deg); }
.menu-open .menu-toggle-bar:nth-child(2) { top: 21.5px; transform: rotate(-30deg); }

@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .header-logo img { width: 124px; }
  .menu-toggle { display: block; z-index: 2; }
  .global-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    padding: var(--header-h) var(--gutter) 40px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
  }
  .menu-open .global-nav { opacity: 1; visibility: visible; }
  .global-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
  .global-nav a {
    font-size: 30px;
    font-weight: 300;
    letter-spacing: .1em;
  }
  .global-nav .nav-cta a { padding: 6px 0; border: 0; }
  .global-nav .nav-cta a:hover { background: none; color: var(--accent); }
  .menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) 0 0;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 1; padding-bottom: 120px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 36px; height: 1px;
  background: var(--accent);
}

.hero-title {
  margin-top: 28px;
  font-size: clamp(34px, 6vw, 78px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: .03em;
}
.hero-title .line { display: block; }

.hero-lead {
  max-width: 34em;
  margin-top: 36px;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 2.1;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 48px;
}

.hero-meta {
  position: absolute;
  left: 0; right: 0; bottom: 32px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-scroll {
  position: relative;
  padding-right: 52px;
}
.hero-scroll::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 40px; height: 1px;
  background: var(--line);
  overflow: hidden;
}
.hero-scroll::before {
  content: "";
  position: absolute;
  right: 28px; top: 50%;
  z-index: 1;
  width: 12px; height: 1px;
  background: var(--ink);
  animation: scrollhint 2.4s var(--ease) infinite;
}
@keyframes scrollhint {
  0%   { transform: translateX(-28px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateX(28px); opacity: 0; }
}

/* ロゴの「U」をかたどった線（js/hero-lines.js が描く） */
.hero-canvas {
  position: absolute;
  top: 0; right: 0;
  z-index: 0;
  width: 44%;
  height: 100%;
  pointer-events: none;
  /* 上下をふわっと消す */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}

@media (max-width: 1100px) {
  /* 見出しと少し重なる幅では、線を薄くする */
  .hero-canvas { opacity: .6; }
}

@media (max-width: 860px) {
  /* 狭い画面では文字の後ろに薄く敷く */
  .hero-canvas { width: 110%; right: -52%; opacity: .45; }
}

@media (max-width: 600px) {
  .hero-inner { padding-bottom: 140px; }
  .hero-actions .btn-primary { width: 100%; }
}

/* ---------- Visual band ---------- */

.visual-band {
  height: clamp(260px, 52vw, 640px);
  overflow: hidden;
}
.visual-band img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* 右側の「U」の造形が、狭い画面でも切れないように */
  object-position: 76% 50%;
}

/* ---------- Sections ---------- */

.section { padding: var(--section-y) 0; }
.section-alt { background: var(--bg-alt); }

.section-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-en);
  text-transform: uppercase;
}
.section-label .num {
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--accent);
}
.section-label .name {
  font-size: 13px;
  letter-spacing: .24em;
  color: var(--muted);
}

.section-head { margin-bottom: clamp(48px, 7vw, 88px); }
.section-head .section-title { margin-top: 24px; }

.section-title {
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .04em;
}

.section-lead {
  max-width: 40em;
  margin-top: 24px;
  color: var(--ink-2);
  line-height: 2.05;
}

/* ラベル左・本文右の2カラム */
.split {
  display: grid;
  grid-template-columns: minmax(160px, 3fr) 9fr;
  gap: 40px clamp(32px, 6vw, 96px);
}
.split-body > .section-title + * { margin-top: 32px; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 28px; }
}

/* Mission */
.statement {
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: .04em;
}
.prose {
  max-width: 38em;
  margin-top: 40px;
  color: var(--ink-2);
  line-height: 2.15;
}
.prose p + p { margin-top: 1.2em; }

/* ---------- Service ---------- */

.service-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px);
}
@media (max-width: 860px) {
  .service-list { grid-template-columns: 1fr; }
}

.service-card {
  --card-pad: clamp(32px, 4.5vw, 56px);
  position: relative;
  padding: var(--card-pad);
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

/* カード上部の画像は、カードの端まで広げる */
.service-figure {
  margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 36px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-alt);
}
.service-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.service-card:hover .service-figure img { transform: scale(1.03); }
.service-card::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px;
  width: calc(100% + 2px); height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease);
}
.service-card:hover::before { transform: scaleX(1); }

.service-head { display: grid; gap: 6px; }
.service-num {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--muted);
}
.service-en {
  margin-top: 18px;
  font-family: var(--font-en);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: .02em;
}
.service-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--muted);
}
.service-copy {
  margin-top: 36px;
  font-size: clamp(19px, 1.9vw, 22px);
  font-weight: 500;
  line-height: 1.6;
}
.service-text {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 2.05;
}
.service-items {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}
.service-items li {
  position: relative;
  padding: 14px 0 14px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.7;
}
.service-items li::before {
  content: "";
  position: absolute;
  /* 1行目の文字の高さの真ん中にそろえる（上の余白14px＋行の高さの半分） */
  left: 2px; top: calc(14px + .85em);
  width: 8px; height: 1px;
  background: var(--accent);
}

/* ---------- Works ---------- */

.works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 40px);
}
@media (max-width: 760px) {
  .works-grid { grid-template-columns: 1fr; }
}

.work { display: block; }
.work-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.work-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1s var(--ease);
}
.work:hover .work-thumb img { transform: scale(1.035); }

.work-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 16px;
  margin-top: 22px;
}
.work-cat {
  grid-column: 1 / -1;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
}
.work-title {
  font-size: clamp(19px, 1.8vw, 22px);
  font-weight: 500;
  letter-spacing: .05em;
}
.work-link {
  font-size: 13px;
  letter-spacing: .08em;
  white-space: nowrap;
  transition: color .3s var(--ease);
}
.work-link .arrow { display: inline-block; transition: transform .3s var(--ease); }
.work:hover .work-link { color: var(--accent); }
.work:hover .work-link .arrow { transform: translate(2px, -2px); }

/* ---------- Process ---------- */

.process-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
}
.process-step {
  padding: 32px clamp(16px, 2vw, 28px) 8px 0;
}
.process-step + .process-step {
  padding-left: clamp(16px, 2vw, 28px);
  border-left: 1px solid var(--line);
}
.process-num {
  font-family: var(--font-en);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
}
.process-step h3 {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .08em;
}
.process-step p {
  margin-top: 12px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-2);
}
@media (max-width: 960px) {
  .process-list { grid-template-columns: 1fr 1fr; }
  .process-step:nth-child(3) { padding-left: 0; border-left: 0; }
  .process-step:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .process-list { grid-template-columns: 1fr; }
  .process-step,
  .process-step + .process-step { padding: 28px 0 24px; border-left: 0; }
  .process-step + .process-step { border-top: 1px solid var(--line); }
  .process-step h3 { margin-top: 16px; }
}

/* ---------- Company ---------- */

.company-table { border-top: 1px solid var(--ink); }
.company-table > div {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 8px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.9;
}
.company-table dt { color: var(--muted); letter-spacing: .1em; }
.company-table dd a {
  border-bottom: 1px solid var(--line);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.company-table dd a:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) {
  .company-table > div { grid-template-columns: 1fr; gap: 2px; padding: 18px 0; }
  .company-table dt { font-size: 13px; }
}

/* ---------- Contact ---------- */

.section-contact { background: var(--bg-alt); }

.contact-form {
  display: grid;
  gap: 28px;
  margin-top: 48px;
  max-width: 760px;
}
.field { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}
/* fieldset の legend は grid の gap が効かないので、下の余白を直接つける */
legend.field-label { margin-bottom: 10px; }
.field-label {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
}
.req {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--accent);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea { resize: vertical; min-height: 180px; line-height: 1.8; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(42, 68, 255, .12);
}

.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  letter-spacing: .06em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.consent {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
}
.consent input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.consent a { border-bottom: 1px solid currentColor; }
.consent a:hover { color: var(--accent); }

.btn-submit { justify-self: start; min-width: 220px; }
@media (max-width: 640px) {
  .btn-submit { justify-self: stretch; }
}

/* bot よけの隠し欄 */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 72px 0 48px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px 48px;
}
.footer-logo img { width: 132px; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 28px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.footer-nav a { color: var(--ink-2); transition: color .3s var(--ease); }
.footer-nav a:hover { color: var(--accent); }
.copyright {
  grid-column: 1 / -1;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
}

/* ---------- Sub pages ---------- */

.page {
  padding: calc(var(--header-h) + clamp(64px, 10vw, 120px)) 0 var(--section-y);
}
.page-narrow { max-width: 820px; }
.page-title {
  margin-top: 24px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .04em;
}
.page-lead { margin-top: 28px; color: var(--ink-2); line-height: 2.05; }
.page-actions { margin-top: 48px; }

.policy { margin-top: 56px; color: var(--ink-2); font-size: 15px; line-height: 2.05; }
.policy h2 {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .06em;
}
.policy h2 + p,
.policy h2 + ul { margin-top: 12px; }
.policy p + p { margin-top: 1em; }
.policy ul { padding-left: 1.2em; list-style: disc; }
.policy li + li { margin-top: .3em; }
.policy a { border-bottom: 1px solid currentColor; }
.policy .policy-date { margin-top: 48px; text-align: right; color: var(--muted); font-size: 14px; }

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .visual-band.reveal { transform: none; }
.js .visual-band.reveal img { transform: scale(1.06); transition: transform 1.8s var(--ease); }
.js .visual-band.reveal.is-visible img { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal,
  .js .visual-band.reveal img { opacity: 1; transform: none; transition: none; }
  .hero-scroll::before { animation: none; }
  .work-thumb img,
  .service-figure img,
  .service-card::before { transition: none; }
}
