/*
 * PAC Inc. の会社サイト (pac-inc.co.jp)。スクロールしない 1 画面。
 * 明るい地に、ロゴの弧を同心の輪に並べた絵 (site.js が描く) を右に大きく置き、左下に見出しを置く。
 * 色は白に近い地・墨色・ロゴの水色〜緑〜青だけ。会社概要と問い合わせは、右から出るパネルに入れる。
 */
:root {
  --paper: #f4f5f7;
  --sheet: #ffffff;
  --ink: #0a0e13;
  --dim: rgba(10, 14, 19, 0.6);
  --line: rgba(10, 14, 19, 0.14);
  --accent: #2f6bff;

  /* 英字は Lexend、日本語は Zen Kaku Gothic New で出る */
  --font: "Lexend", "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;

  --gutter: clamp(22px, 4vw, 64px);
}

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

html {
  background: var(--paper);
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

/* 選んでいない言語の文は出さない (html の lang を site.js が切り替える) */
html:lang(en) [lang="ja"],
html:lang(ja) [lang="en"] {
  display: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---- 背景の絵 ---- */

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- 上: 社名と、About / Contact / 言語 ---- */

.head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 3.4vh, 32px) var(--gutter) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.brand img {
  display: block;
  width: auto;
  height: 30px;
}

/* 絵の上に載るので、地の色の丸い帯に入れて読めるようにする */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  padding: 5px 6px 5px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 245, 247, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.nav a {
  position: relative;
  padding: 8px 0;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav a:hover::after {
  transform: scaleX(1);
}

/* 言語の切り替え */
.lang {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
}

.lang button {
  min-width: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  transition:
    color 0.2s,
    background-color 0.2s;
}

.lang button:hover {
  color: var(--ink);
}

.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--sheet);
}

/* ---- 下: 見出し ---- */

.base {
  position: relative;
  padding: 0 var(--gutter) clamp(20px, 4.4vh, 44px);
}

.copy {
  max-width: min(660px, 46vw);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.copy h1 {
  font-size: clamp(26px, min(4.7vw, 8.4vh), 66px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.copy h1:lang(ja) {
  font-size: clamp(22px, min(3.9vw, 7.4vh), 54px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.copy p {
  max-width: 34em;
  margin-top: clamp(14px, 2.6vh, 24px);
  color: var(--dim);
  font-size: clamp(14px, 1.1vw, 16px);
  text-wrap: pretty;
}

.copy p:lang(ja) {
  line-height: 1.85;
}

.foot {
  margin-top: clamp(18px, 3.6vh, 34px);
  color: var(--dim);
  font-size: 12px;
}

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

/*
 * 狭い画面と縦長の画面 (site.js の NARROW と同じ条件)。絵は画面より大きい輪の一部を見せる形になり、
 * 画面いっぱいに広がるので、上の社名と下の文字の後ろでは地の色へ溶かす。
 */
@media (max-width: 719px), (max-aspect-ratio: 9/10) {
  .head::before,
  .base::before {
    position: absolute;
    content: "";
    pointer-events: none;
  }

  .head::before {
    inset: 0 0 -44px;
    background: linear-gradient(to top, rgba(244, 245, 247, 0), var(--paper) 62px);
  }

  .base::before {
    inset: -120px 0 0;
    background: linear-gradient(to bottom, rgba(244, 245, 247, 0), var(--paper) 150px);
  }

  .brand,
  .nav,
  .copy,
  .foot {
    position: relative;
  }

  .copy {
    max-width: 660px;
  }

  .copy h1 {
    font-size: clamp(26px, min(10.6vw, 7.4vh), 64px);
    line-height: 1.06;
  }

  .copy h1:lang(ja) {
    font-size: clamp(22px, min(8vw, 5.8vh), 52px);
    line-height: 1.32;
  }

  .copy p {
    font-size: clamp(15px, 2.2vw, 17px);
  }

  /* 言語の切り替えは右下へ出し、上の帯は About と Contact だけにする */
  .nav {
    padding: 3px 16px;
    background: rgba(244, 245, 247, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .lang {
    position: fixed;
    z-index: 1;
    right: var(--gutter);
    bottom: calc(clamp(20px, 4.4vh, 44px) - 8px);
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(244, 245, 247, 0.94);
  }
}

/* 横向きのスマホのように高さが低い画面。見出しは上の指定で高さに合わせて小さくなるので、本文と余白も詰める */
@media (max-height: 430px) {
  .copy p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.55;
  }

  .copy p:lang(ja) {
    line-height: 1.65;
  }

  .foot {
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .brand {
    gap: 9px;
    font-size: 15px;
  }

  .brand img {
    height: 24px;
  }

  .nav {
    gap: 14px;
    font-size: 13px;
  }
}

/* ---- About と Contact のパネル (右から出る) ---- */

.panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(560px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: -30px 0 80px rgba(10, 14, 19, 0.1);
}

.panel-wide {
  width: min(640px, 100vw);
}

/*
 * JavaScript が動かないときも、#about・#contact の付いた URL なら中身を出す。
 * 動くときは出さない (閉じて # を外しても :target は残るので、閉じたパネルが出たままになる)。
 */
html:not(.js) .panel:target:not([open]) {
  z-index: 2;
  display: block;
}

.panel::backdrop {
  background: rgba(244, 245, 247, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.panel[open] {
  animation: panel-in 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}

.panel-body {
  padding: clamp(22px, 4vh, 40px) clamp(22px, 4vw, 44px) 40px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(18px, 3.4vh, 34px);
}

.panel-head h2 {
  font-size: clamp(28px, 3.6vh, 36px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-head h2:lang(ja) {
  font-size: clamp(24px, 3.2vh, 30px);
  font-weight: 400;
  letter-spacing: 0;
}

.panel-head button {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

.panel-head button:hover {
  border-color: var(--ink);
}

.facts {
  border-top: 1px solid var(--ink);
}

.facts > div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 2px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.95;
}

.facts dd {
  font-size: 15px;
  font-weight: 400;
}

.facts a {
  border-bottom: 1px solid currentColor;
  color: var(--accent);
}

/* ---- Contact のフォーム ---- */

.result {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.result strong {
  font-size: 17px;
  font-weight: 400;
}

.result p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 14px;
}

#contact-thanks {
  border-color: var(--accent);
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding-top: clamp(16px, 2.6vh, 24px);
  border-top: 1px solid var(--ink);
}

.form[hidden] {
  display: none;
}

.form .full {
  grid-column: 1 / -1;
}

.form label {
  display: flex;
  flex-direction: column;
}

.form label span {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.form input,
.form select,
.form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(10, 14, 19, 0.24);
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230a0e13' stroke-opacity='.6' stroke-width='1.4'/%3E%3C/svg%3E");
  background-position: right 13px center;
  background-size: 11px;
  background-repeat: no-repeat;
  appearance: none;
}

.form textarea {
  resize: vertical;
}

.form input:hover,
.form select:hover,
.form textarea:hover {
  border-color: rgba(10, 14, 19, 0.5);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.16);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 4px;
}

.form-foot p {
  max-width: 26em;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.form-foot a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-foot button {
  min-width: 132px;
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s;
}

.form-foot button:hover {
  background: var(--accent);
}

@media (max-width: 560px) {
  .panel {
    border-left: 0;
  }

  .form {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-foot button {
    width: 100%;
  }

  .facts > div {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 0;
  }

  .facts dt {
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .copy,
  .panel[open] {
    animation: none;
  }

  .nav a::after {
    transition: none;
  }
}
