/* 紙のような明るい1画面に、傾けたアプリのアイコンが斜めに並ぶ（参考：a24.raviklaassens.com）。
   スクロール・スワイプ・矢印キーで、真ん中のアプリが入れ替わる。ABOUT と CONTACT は、上に重なるパネル（#about・#contact）。 */
:root {
  color-scheme: light;
  --bg: #f2f2f0;
  --text: #141414;
  --muted: #7a7a76;
  --line: #141414;
  --line-soft: #d6d6d2;
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --serif: "Instrument Serif", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --gutter: clamp(12px, 2vw, 24px);
  /* 紙の質感（細かいノイズ） */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* メニュー（PC は上の真ん中、スマホは下の白い帯） */
.menu {
  position: fixed; z-index: 30; top: var(--gutter); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 28px;
  font-size: 0.8rem; font-weight: 500;
}
.menu .brand { font-family: var(--serif); font-size: 1.35rem; line-height: 1; }
.menu a:hover { opacity: 0.5; }

/* 左上：いまのアプリの情報 */
.info-card { position: fixed; z-index: 10; top: var(--gutter); left: var(--gutter); width: min(300px, 40vw); }
.info-card .title { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1; margin: 0 0 10px; text-transform: uppercase; }
.info-card dl { margin: 0; border-top: 1px solid var(--line); }
.info-card dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.info-card dt { font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; padding-top: 3px; }
.info-card dd { margin: 0; font-size: 0.85rem; font-weight: 500; text-align: right; }

/* 下：短い紹介 */
.lines {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: calc(var(--gutter) + 8px);
  display: flex; justify-content: center; gap: clamp(24px, 8vw, 120px);
  font-family: var(--serif); font-size: clamp(1rem, 1.6vw, 1.35rem); line-height: 1.2; text-align: center;
  pointer-events: none;
}
.lines p { margin: 0; }
.lines p::before { content: ""; display: block; width: 24px; height: 1px; background: currentColor; margin: 0 auto 10px; }

/* 入れ替わるときに、文字をふわっと出す */
[data-field] { transition: opacity 0.35s, transform 0.35s; }
.swapping [data-field] { opacity: 0; transform: translateY(4px); }

.copyright { position: fixed; z-index: 10; bottom: var(--gutter); right: var(--gutter); margin: 0; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; }

/* アイコン。JS が無いときは、真ん中に並べる。 */
.field {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 40px;
  perspective: 1400px;
  touch-action: pan-y;
}
.app { display: block; width: clamp(120px, 22vw, 200px); }
.app img {
  width: 100%; height: auto; border-radius: 22%;
  /* 厚みと影 */
  box-shadow:
    0 1px 0 #c9c9c4, 0 2px 0 #bdbdb7, 0 3px 0 #b3b3ad, 0 4px 0 #a9a9a3,
    0 30px 60px rgba(0, 0, 0, 0.18), 0 10px 20px rgba(0, 0, 0, 0.12);
  -webkit-user-drag: none; user-select: none;
}
.app:focus-visible { outline: none; }
.app:focus-visible img { outline: 2px solid var(--text); outline-offset: 8px; }

.js .field { display: block; cursor: grab; }
.js .field.dragging { cursor: grabbing; }
.js .app { position: absolute; left: 0; top: 0; width: var(--size, 300px); transform-style: preserve-3d; will-change: transform; }

/* パネル（ABOUT・CONTACT） */
.panel {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg) var(--grain);
  overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s;
}
.panel:target { opacity: 1; visibility: visible; }
.panel-inner { max-width: 760px; margin: 0 auto; padding: calc(var(--gutter) + 72px) var(--gutter) 96px; }
.close { position: fixed; top: var(--gutter); right: var(--gutter); font-size: 0.8rem; font-weight: 500; }
.close:hover { opacity: 0.5; }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(4rem, 14vw, 9rem); line-height: 0.85; text-transform: uppercase; margin: 0 0 32px; }
.panel h3 { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; margin: 56px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.panel .lead { font-size: 1rem; margin: 0; }
.panel .note { color: var(--muted); font-size: 0.85rem; }
.mail { font-family: var(--serif); font-size: clamp(2rem, 7vw, 4rem); line-height: 1.1; margin: 40px 0; }
.mail a { border-bottom: 1px solid currentColor; }
.mail a:hover { opacity: 0.6; }

.services { list-style: none; padding: 0; margin: 0; }
.services a {
  display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.services a:hover .name { opacity: 0.6; }
.services img { grid-row: span 2; border-radius: 22%; }
.services .name { font-weight: 600; line-height: 1.4; }
.services .name small { margin-left: 8px; font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.services .desc { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

.info { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.info th, .info td { border-bottom: 1px solid var(--line-soft); padding: 12px 0; text-align: left; vertical-align: top; }
.info th { width: 9em; color: var(--muted); font-weight: 400; }
.info a { border-bottom: 1px solid currentColor; }

/* 404 */
.notfound { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: var(--gutter); }
.notfound h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(6rem, 24vw, 16rem); line-height: 0.85; margin: 0; }
.notfound p { margin: 16px 0 0; }
.notfound p a { border-bottom: 1px solid currentColor; }

@media (max-width: 640px) {
  .menu {
    top: auto; bottom: var(--gutter);
    background: #fff; padding: 12px 22px; gap: 22px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  }
  .info-card { width: auto; right: var(--gutter); }
  .lines { bottom: 92px; flex-direction: column; gap: 14px; }
  .copyright { display: none; }
  .info th, .info td { display: block; width: auto; }
  .info th { border-bottom: 0; padding-bottom: 0; }
}
