/*
Theme Name: Royfer Solutions
Theme URI: https://royfer.co.jp/
Author: Royfer Solutions
Author URI: https://royfer.co.jp/
Description: Royfer Solutions 株式会社のコーポレートテーマ。AI開発とハードウェア（カードリーダー）開発を手がけるシステム開発会社向けの、上品で洗練されたデザイン。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: royfer
*/

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --navy:        #3E4C66;
  --navy-deep:   #2E3A50;
  --navy-ink:    #232E40;
  --beige:       #C2B49E;
  --beige-soft:  #D4C8B4;
  --beige-pale:  #E8E0D3;
  --gray:        #9CA3B0;
  --paper:       #F5F3EE;
  --paper-warm:  #FAF8F3;
  --white:       #FFFFFF;
  --line:        #E4DFD4;
  --text:        #2B3038;
  --text-soft:   #5A6270;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 10px rgba(46, 58, 80, 0.06);
  --shadow-md: 0 12px 40px rgba(46, 58, 80, 0.10);
  --shadow-lg: 0 30px 80px rgba(46, 58, 80, 0.16);

  --serif: 'Poppins', -apple-system, sans-serif;
  --jp: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--jp);
  color: var(--text);
  background: var(--paper);
  line-height: 1.85;
  font-size: 16px;
  font-feature-settings: "palt";
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* タッチ操作の快適化 */
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--beige); color: var(--white); }

/* Latin headings use Poppins Light, the logo's font */
.font-latin {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.06em;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 12vw, 150px); }
.section--paper { background: var(--paper); }
.section--warm { background: var(--paper-warm); }
.section--white { background: var(--white); }
.section--navy { background: var(--navy); color: var(--white); }

/* Eyebrow label with the signature arc dot */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--beige);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--beige);
}
.section--navy .eyebrow { color: var(--beige-soft); }

.section-title {
  font-family: var(--jp);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--navy-ink);
}
.section--navy .section-title { color: var(--white); }

.section-lead {
  margin-top: 24px;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 2;
}
.section--navy .section-lead { color: rgba(255,255,255,0.78); }

/* Signature smile-arc divider */
.arc-divider {
  display: block;
  width: 120px;
  margin: 28px 0 0;
  overflow: visible;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 34px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 100px;
  transition: all 0.4s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }

.btn--primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--navy-deep);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--navy); background: var(--white); }

.btn--light {
  background: var(--white);
  color: var(--navy);
}
.btn--light:hover { background: var(--beige-pale); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  transition: all 0.45s var(--ease);
  background: transparent;
}
.site-header.is-scrolled {
  background: rgba(245, 243, 238, 0.85);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  transition: height 0.45s var(--ease);
}
.site-header.is-scrolled .site-header__inner { height: 70px; }

.site-logo { display: block; }
.site-logo img { height: 38px; width: auto; transition: height 0.45s var(--ease); }
.site-header.is-scrolled .site-logo img { height: 32px; }

.nav { display: flex; align-items: center; gap: 38px; }
.nav__menu { display: flex; align-items: center; gap: 34px; }
.nav__menu a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  position: relative;
  padding-block: 6px;
  transition: color 0.3s;
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--beige);
  transition: width 0.4s var(--ease);
}
.nav__menu a:hover { color: var(--navy); }
.nav__menu a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: var(--navy);
  transition: all 0.4s var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(194, 180, 158, 0.22) 0%, transparent 55%),
    radial-gradient(100% 80% at 5% 90%, rgba(62, 76, 102, 0.08) 0%, transparent 50%),
    var(--paper);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}
.hero__eyebrow {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--beige);
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.2s forwards;
}
.hero__title {
  font-family: var(--jp);
  font-weight: 700;
  font-size: clamp(34px, 5.6vw, 68px);
  line-height: 1.32;
  letter-spacing: 0.02em;
  color: var(--navy-ink);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line span {
  display: inline-block;
  transform: translateY(110%);
  animation: lineUp 1s var(--ease) forwards;
}
.hero__title .line:nth-child(1) span { animation-delay: 0.35s; }
.hero__title .line:nth-child(2) span { animation-delay: 0.5s; }
.hero__title .line:nth-child(3) span { animation-delay: 0.65s; }
.hero__title .accent { color: var(--beige); }

.hero__lead {
  margin-top: 34px;
  max-width: 480px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 2.1;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.9s forwards;
}
.hero__actions {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 1.05s forwards;
}
.hero__visual {
  position: relative;
  opacity: 0;
  animation: fadeIn 1.4s var(--ease) 0.7s forwards;
}
.hero__visual-card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-ink) 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero__visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(194,180,158,0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(194,180,158,0.15) 0%, transparent 45%);
}
.hero__visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 60% 40%, black 0%, transparent 75%);
}
.hero__visual-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__visual-mark svg { width: 56%; }
.hero__float {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero__float--ai { top: 14%; left: -32px; animation: floaty 6s ease-in-out infinite; }
.hero__float--hw { bottom: 12%; right: -28px; animation: floaty 6s ease-in-out infinite 1.5s; }
.hero__float .dot { width: 10px; height: 10px; border-radius: 50%; }
.hero__float .dot--beige { background: var(--beige); }
.hero__float .dot--navy { background: var(--navy); }
.hero__float .label { font-size: 13px; font-weight: 600; color: var(--navy-ink); }
.hero__float .sub { font-size: 11px; color: var(--gray); font-family: var(--serif); letter-spacing: 0.08em; }

.hero__scroll {
  position: absolute;
  bottom: 38px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 1s ease 1.6s forwards;
}
.hero__scroll .bar {
  width: 1px; height: 46px;
  background: linear-gradient(var(--beige), transparent);
  animation: scrollBar 2.2s ease-in-out infinite;
}

/* ============================================================
   Stats strip
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
.stat { text-align: center; }
.stat__num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 5vw, 60px);
  color: var(--navy);
  line-height: 1;
  letter-spacing: 0.02em;
}
.stat__num .unit { font-size: 0.42em; color: var(--beige); margin-left: 4px; font-weight: 400; }
.stat__label {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

/* ============================================================
   Services
   ============================================================ */
.services__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 60px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  border: 1px solid var(--line);
  transition: all 0.5s var(--ease);
  position: relative;
  overflow: hidden;
}
.service-card::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--beige), var(--navy));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.service-card:hover::after { transform: scaleX(1); }
.service-card__icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--paper-warm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  transition: background 0.5s var(--ease);
}
.service-card:hover .service-card__icon { background: var(--beige-pale); }
.service-card__icon svg { width: 30px; height: 30px; stroke: var(--navy); fill: none; stroke-width: 1.5; }
.service-card__no {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--beige);
  margin-bottom: 10px;
}
.service-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-ink);
  margin-bottom: 16px;
  line-height: 1.5;
}
.service-card__desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 2;
}
.service-card__tags {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.service-card__tags span {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--navy);
  background: var(--paper);
  padding: 5px 12px;
  border-radius: 100px;
}

/* ============================================================
   Feature split (AI / Hardware showcase)
   ============================================================ */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 90px);
  align-items: center;
}
.feature + .feature { margin-top: clamp(80px, 12vw, 140px); }
.feature--reverse .feature__visual { order: 2; }
.feature__visual {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.feature__visual--ai { background: linear-gradient(150deg, #424F6B, #2A3447); }
.feature__visual--hw { background: linear-gradient(150deg, #C2B49E, #9E8E73); }
.feature__visual-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.feature__visual-inner svg { width: 50%; opacity: 0.92; }
.feature__visual .badge {
  position: absolute;
  top: 26px; left: 26px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(6px);
  padding: 8px 16px;
  border-radius: 100px;
}
.feature__body .eyebrow { margin-bottom: 18px; }
.feature__title {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  color: var(--navy-ink);
  line-height: 1.45;
  margin-bottom: 24px;
}
.feature__text { color: var(--text-soft); line-height: 2.1; font-size: 15px; }
.feature__list { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.feature__list li {
  display: flex; align-items: flex-start; gap: 14px;
  font-size: 15px; color: var(--text);
}
.feature__list li::before {
  content: "";
  flex-shrink: 0;
  width: 8px; height: 8px;
  margin-top: 11px;
  border-radius: 50%;
  background: var(--beige);
}

/* ============================================================
   Process / Approach
   ============================================================ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.process-step {
  position: relative;
  padding-top: 34px;
}
.process-step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 46px;
  color: var(--beige);
  opacity: 0.55;
  line-height: 1;
}
.process-step h4 { margin: 16px 0 12px; font-size: 17px; font-weight: 700; color: var(--white); }
.process-step p { font-size: 13.5px; color: rgba(255,255,255,0.7); line-height: 1.95; }
.process-step .line {
  position: absolute; top: 14px; right: -12px;
  width: 24px; height: 1px;
  background: rgba(194,180,158,0.4);
}

/* ============================================================
   Works / Cases
   ============================================================ */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.work-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  transition: all 0.5s var(--ease);
}
.work-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.work-card__media {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.work-card__media--a { background: linear-gradient(140deg, #3E4C66, #2A3447); }
.work-card__media--b { background: linear-gradient(140deg, #C2B49E, #A8987C); }
.work-card__media svg { width: 34%; opacity: 0.9; }
.work-card__media.has-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-card__media.has-thumb { background: var(--navy); }
.work-card__body { padding: 30px 32px 36px; }
.work-card__cat {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--beige);
}
.work-card__title { font-size: 19px; font-weight: 700; color: var(--navy-ink); margin: 10px 0 12px; line-height: 1.5; }
.work-card__desc { font-size: 14px; color: var(--text-soft); line-height: 1.95; }

/* ============================================================
   Company table
   ============================================================ */
.company {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(40px, 7vw, 80px);
  align-items: start;
}
.company-table { width: 100%; border-collapse: collapse; }
.company-table th, .company-table td {
  text-align: left;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 15px;
}
.company-table th {
  width: 34%;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.company-table td { color: var(--text-soft); }

/* ============================================================
   CTA
   ============================================================ */
.cta {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-ink) 100%);
  padding: clamp(50px, 8vw, 90px);
  text-align: center;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(194,180,158,0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(194,180,158,0.14) 0%, transparent 45%);
}
.cta__inner { position: relative; z-index: 1; }
.cta__title {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.5;
  margin-bottom: 22px;
}
.cta__lead { color: rgba(255,255,255,0.78); max-width: 540px; margin: 0 auto 40px; line-height: 2; }

/* ============================================================
   Contact form
   ============================================================ */
.contact {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 7vw, 80px);
}
.contact__info p { color: var(--text-soft); line-height: 2.1; margin-bottom: 28px; }
.contact__detail { display: flex; flex-direction: column; gap: 20px; }
.contact__detail-item { display: flex; align-items: center; gap: 16px; }
.contact__detail-item .ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--paper-warm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact__detail-item .ic svg { width: 20px; height: 20px; stroke: var(--navy); fill: none; stroke-width: 1.6; }
.contact__detail-item .k { font-family: var(--serif); font-size: 11px; letter-spacing: 0.15em; color: var(--gray); text-transform: uppercase; }
.contact__detail-item .v { font-size: 15px; color: var(--navy-ink); font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { margin-bottom: 22px; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.form-field label .req { color: var(--beige); margin-left: 4px; }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-family: var(--jp);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(62,76,102,0.08);
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-submit { margin-top: 8px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--navy-ink); color: rgba(255,255,255,0.7); }
.site-footer__main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-block: 80px 60px;
}
.site-footer__brand img { height: 40px; margin-bottom: 24px; }
.site-footer__brand p { font-size: 13.5px; line-height: 2; max-width: 280px; }
.footer-col h5 {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--beige-soft);
  margin-bottom: 22px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 13px; }
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.7); transition: color 0.3s; }
.footer-col a:hover { color: var(--white); }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-block: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-family: var(--serif);
  letter-spacing: 0.04em;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lineUp { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes scrollBar { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Photo slots (customizer images)
   ============================================================ */
/* Hero background photo with navy overlay to keep brand mood */
.hero.has-photo {
  background: var(--paper);
}
.hero__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(245,243,238,0.97) 0%, rgba(245,243,238,0.82) 38%, rgba(46,58,80,0.30) 100%),
    radial-gradient(120% 90% at 85% 10%, rgba(194,180,158,0.20) 0%, transparent 55%);
}
.hero .container { position: relative; z-index: 1; }

/* Hero side card: real photo fills the navy card */
.hero__visual-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero__visual-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(46,58,80,0.30), rgba(35,46,64,0.55));
}

/* Generic photo fill for service icon-card / feature visual / about */
.has-photo-fill {
  background-size: cover !important;
  background-position: center !important;
  position: relative;
}

/* Service cards: optional photo on top of the card */
.service-card__photo {
  height: 168px;
  margin: -44px -36px 28px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.service-card__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(46,58,80,0.05), rgba(46,58,80,0.18));
}

/* Feature visual photo (replaces the gradient + svg) */
.feature__visual.has-photo .feature__visual-inner { display: none; }
.feature__visual-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.feature__visual.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(46,58,80,0.18), rgba(46,58,80,0.05));
}

/* About photo */
.about-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 9 / 11;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
  background-color: var(--navy);
}
.company--with-photo {
  grid-template-columns: 0.9fr 1.1fr;
  align-items: start;
}
.company--with-photo .company__photo-col { position: sticky; top: 110px; }

/* CTA background photo */
.cta.has-photo::before {
  background:
    linear-gradient(135deg, rgba(46,58,80,0.92) 0%, rgba(35,46,64,0.88) 100%),
    var(--cta-photo) center/cover;
  opacity: 1;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 50px; }
  .hero__visual { max-width: 420px; margin-inline: auto; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .process-step .line { display: none; }
  .feature, .feature--reverse .feature__visual { grid-template-columns: 1fr; order: 0; }
  .company, .contact { grid-template-columns: 1fr; }
  .site-footer__main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav__menu { display: none; }
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 340px);
    background: var(--paper-warm);
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  .nav.is-open { transform: none; }
  .nav.is-open .nav__menu { display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
  .nav.is-open .nav__menu a { font-size: 18px; }
  .nav-cta-wrap { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 40px 20px; }
  .service-grid { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .services__head { flex-direction: column; align-items: flex-start; }
  .site-footer__main { grid-template-columns: 1fr; gap: 36px; }
  .site-footer__bottom { flex-direction: column; gap: 14px; text-align: center; }
  .hero__float--ai { left: 8px; }
  .hero__float--hw { right: 8px; }
}

/* ============================================================
   Mobile-first optimisation (≤ 600px)
   タッチ操作・可読性・余白・パフォーマンスを最適化
   ============================================================ */
@media (max-width: 600px) {
  :root {
    --gutter: 20px;
    --radius: 12px;
    --radius-lg: 16px;
  }

  body { font-size: 15px; line-height: 1.8; }

  /* セクション余白を圧縮して縦スクロール量を減らす */
  .section { padding-block: 56px; }

  /* ヘッダー：高さを抑えてコンテンツ領域を広く */
  .site-header__inner { height: 64px; }
  .site-header.is-scrolled .site-header__inner { height: 56px; }
  .site-logo img { height: 30px; }
  .site-header.is-scrolled .site-logo img { height: 28px; }

  /* ハンバーガーのタップ領域を確保 */
  .nav-toggle { width: 48px; height: 48px; }

  /* ヒーロー：縦に積んで余白最適化、タイトルを読みやすく */
  .hero { min-height: auto; padding-top: 96px; padding-bottom: 64px; }
  .hero__grid { gap: 36px; }
  .hero__eyebrow { font-size: 11px; letter-spacing: 0.22em; margin-bottom: 18px; }
  .hero__title { font-size: 32px; line-height: 1.4; }
  .hero__lead { margin-top: 24px; font-size: 15px; line-height: 1.95; }
  .hero__actions { margin-top: 30px; gap: 12px; }
  /* ボタンを全幅・大きめタップ領域に */
  .hero__actions .btn { width: 100%; justify-content: center; padding: 16px 24px; }
  .hero__visual { max-width: 320px; }
  .hero__visual-card { aspect-ratio: 1 / 1; }
  /* フロート吹き出しは小さく内側へ */
  .hero__float { padding: 12px 16px; }
  .hero__float .label { font-size: 12px; }
  .hero__float .sub { font-size: 10px; }
  .hero__float--ai { left: -4px; top: 10%; }
  .hero__float--hw { right: -4px; bottom: 10%; }
  .hero__scroll { display: none; }

  /* 見出しサイズ */
  .section-title { font-size: 24px; line-height: 1.45; }
  .eyebrow { font-size: 11px; letter-spacing: 0.24em; margin-bottom: 16px; }
  .section-lead { margin-top: 18px; font-size: 14px; line-height: 1.9; }

  /* 統計：2列、間隔を詰める */
  .stats { grid-template-columns: 1fr 1fr; gap: 32px 16px; }
  .stat__num { font-size: 38px; }
  .stat__label { font-size: 12px; margin-top: 8px; }

  /* サービスカード：余白を最適化 */
  .services__head { gap: 20px; margin-bottom: 36px; }
  .service-grid { gap: 16px; }
  .service-card { padding: 32px 24px; }
  .service-card__photo { margin: -32px -24px 22px; height: 150px; }
  .service-card__title { font-size: 18px; }
  .service-card__desc { font-size: 14px; }

  /* 技術領域 */
  .feature + .feature { margin-top: 56px; }
  .feature { gap: 28px; }
  .feature__title { font-size: 22px; }
  .feature__text { font-size: 14px; line-height: 1.95; }
  .feature__list li { font-size: 14px; }

  /* プロセス：1列に。番号を少し小さく */
  .process-grid { grid-template-columns: 1fr; gap: 28px; }
  .process-step { padding-top: 8px; padding-left: 56px; position: relative; }
  .process-step::before { position: absolute; left: 0; top: 0; font-size: 38px; }
  .process-step h4 { margin-top: 0; }

  /* 実績カード */
  .work-card__body { padding: 24px 22px 28px; }
  .work-card__title { font-size: 18px; }

  /* 会社概要：写真ありでも1列に */
  .company--with-photo { grid-template-columns: 1fr; }
  .company--with-photo .company__photo-col { position: static; }
  .about-photo { aspect-ratio: 4 / 3; margin-bottom: 28px; }
  .company-table th, .company-table td { font-size: 14px; padding: 16px 4px; }
  .company-table th { width: 32%; }

  /* お問い合わせ：入力欄を大きく、iOSズーム防止 */
  .contact { gap: 36px; }
  .contact__detail-item .v { font-size: 14px; }
  .form-field input,
  .form-field textarea,
  .form-field select { font-size: 16px; padding: 14px 14px; }
  .form-field textarea { min-height: 120px; }
  .form-submit .btn { width: 100%; justify-content: center; }

  /* CTA */
  .cta { padding: 44px 26px; }
  .cta__title { font-size: 24px; }
  .cta__lead { font-size: 14px; margin-bottom: 30px; }
  .cta .btn { width: 100%; justify-content: center; }

  /* フッター */
  .site-footer__main { padding-block: 56px 44px; }
  .site-footer__brand img { height: 34px; }

  /* 汎用：全 .btn のタップ領域を確保 */
  .btn { min-height: 50px; }
}

/* 極小デバイス（≤ 380px）の微調整 */
@media (max-width: 380px) {
  .hero__title { font-size: 28px; }
  .section-title { font-size: 22px; }
  .stat__num { font-size: 32px; }
  .hero__float { display: none; }
}
