@charset "utf-8";

/* ===========================================================================
   sh4.css — SILENT HILL 4 体験版ページ
   302号室：汚れた壁、鎖で塞がれたドアと覗き穴、ドアの下のメモ、壁の穴。
   =========================================================================== */

:root {
  --wall: #1e201c;
  --wall-2: #151613;
  --ink: #2a2520;
  --paper: #d9cfb4;
  --paper-2: #c4b894;
  --red-paper: #7e1a15;
  --blood: #6e1612;
  --text: #cbc6b6;
  --text-dim: #8b877a;
  --metal: #8c877b;
  --type: "Special Elite", "Courier New", monospace;
  --hand: "Klee One", "Yu Kyokasho", "Hiragino Maru Gothic ProN", cursive;
  --serif: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--wall);
  background-image:
    radial-gradient(ellipse 30% 22% at 12% 18%, rgba(70, 58, 36, 0.35), transparent 70%),
    radial-gradient(ellipse 22% 30% at 88% 42%, rgba(60, 50, 30, 0.3), transparent 70%),
    radial-gradient(ellipse 35% 20% at 30% 78%, rgba(55, 30, 22, 0.28), transparent 70%),
    linear-gradient(var(--wall), var(--wall-2));
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.03em;
  overflow-x: hidden;
}

/* 壁の汚れ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035' numOctaves='5' seed='11'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}

/* 部屋の暗さ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
}

a { color: inherit; }

a:focus-visible { outline: 2px dashed var(--blood); outline-offset: 4px; }

::selection { background: var(--blood); color: #fff; }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 32px);
  font-family: var(--type);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.topbar a { text-decoration: none; transition: color 0.3s; }
.topbar a:hover { color: #e0d8c0; }

/* ------------------------------------------------------------ door */

.door-area {
  position: relative;
  padding: clamp(16px, 4vh, 40px) 0 90px;
}

.door {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 28px 120px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 8%, transparent 92%, rgba(0, 0, 0, 0.3)),
    linear-gradient(#4a463c, #3a372f 60%, #302d27);
  border: 10px solid #26241f;
  border-bottom: 0;
  box-shadow: 0 0 0 2px #121210, 0 30px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* 板の区切り */
.door::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.plate {
  position: relative;
  z-index: 3;
  width: 120px;
  margin: 0 auto 28px;
  padding: 2px 0;
  text-align: center;
  font-family: var(--type);
  font-size: 30px;
  letter-spacing: 0.12em;
  color: #2a241a;
  background: linear-gradient(135deg, #b39a62, #806b3d 50%, #a88f58);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 覗き穴 */
.peephole {
  position: relative;
  z-index: 3;
  width: min(78vw, 340px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  padding: 12px;
  background: radial-gradient(circle, #8f8a7d 60%, #4b473f 72%, #9d978a 86%, #3c3932);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.peephole .lens {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
}

.peephole img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.1);
  filter: sepia(0.25) contrast(1.05);
}

/* 魚眼レンズの縁の暗さ */
.peephole .lens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 36px 14px rgba(0, 0, 0, 0.92);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 240, 0.12), transparent 40%);
}

/* 鎖（X字に交差） */
.chain {
  position: absolute;
  z-index: 2;
  left: -20%;
  width: 140%;
  height: 26px;
  top: 50%;
  pointer-events: none;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.6));
}

.chain.c1 { transform: rotate(38deg); }
.chain.c2 { transform: rotate(-38deg); }
.chain.c3 { top: 78%; transform: rotate(4deg); }

.lock {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 78%;
  width: 44px;
  height: 40px;
  margin: -6px 0 0 -22px;
  background: linear-gradient(135deg, #8a7a55, #5c4f33 60%, #7a6c4b);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.lock::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -18px;
  width: 26px;
  height: 24px;
  border: 5px solid #8c877b;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}

.lock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 6px;
  height: 12px;
  margin-left: -3px;
  border-radius: 3px;
  background: #1a1812;
}

.door-knob {
  position: absolute;
  z-index: 3;
  right: 36px;
  top: 54%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d8c998, #7d6a3e 60%, #3f3420);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);
}

/* ドアの下に差し込まれた赤いメモ */
.red-memo {
  position: relative;
  z-index: 5;
  width: min(92%, 340px);
  margin: -70px auto 0;
  padding: 20px 26px 22px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.18'/%3E%3C/svg%3E"),
    linear-gradient(170deg, #8e231c, var(--red-paper) 60%, #6a1411);
  color: #f1e3d0;
  font-family: var(--hand);
  transform: rotate(-3deg);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 2%, 8% 0, 30% 1.5%, 55% 0, 78% 1%, 100% 0, 99% 40%, 100% 100%, 70% 98.5%, 40% 100%, 12% 98%, 0 100%, 1% 55%);
}

.red-memo .memo-title {
  margin: 0 0 6px;
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(241, 227, 208, 0.7);
}

.red-memo ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 19px;
  line-height: 1.9;
}

.red-memo a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.red-memo a:hover { color: #fff; text-decoration-style: wavy; }

.red-memo li::before { content: "― "; opacity: 0.7; }

/* ------------------------------------------------------------ headings */

.heading {
  margin: clamp(56px, 10vh, 96px) 0 32px;
  text-align: center;
  font-family: var(--type);
  font-weight: normal;
  font-size: clamp(24px, 4.4vw, 34px);
  letter-spacing: 0.24em;
  color: #d9d2bd;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.heading small {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ note paper */

.note {
  position: relative;
  max-width: 40em;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 52px) clamp(40px, 6vw, 60px);
  color: var(--ink);
  background:
    radial-gradient(ellipse 30% 20% at 85% 12%, rgba(120, 80, 30, 0.22), transparent 70%),
    radial-gradient(ellipse 25% 18% at 10% 85%, rgba(110, 22, 18, 0.18), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.14'/%3E%3C/svg%3E"),
    linear-gradient(175deg, var(--paper), var(--paper-2));
  transform: rotate(0.6deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 0, 100% 0, 100% 96%, 94% 99%, 86% 96.5%, 77% 99.5%, 66% 97%, 55% 100%, 44% 97%, 33% 99.5%, 22% 96.8%, 12% 99.2%, 4% 97%, 0 99%);
}

.note .note-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(42, 37, 32, 0.35);
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #5a5043;
}

.note p {
  margin: 0 0 1.2em;
  text-indent: 1em;
}

.note p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ photos */

.photos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 44px 36px;
  counter-reset: photo;
}

.photos li {
  counter-increment: photo;
  display: flex;
  justify-content: center;
}

.photos figure {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0;
  padding: 12px 12px 14px;
  background: linear-gradient(170deg, #e2dccb, #cbc3ad);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.65);
  transform: rotate(-1.4deg);
  transition: transform 0.4s ease;
}

.photos li:nth-child(even) figure { transform: rotate(1.2deg); }
.photos li:nth-child(3n) figure { transform: rotate(-0.5deg); }

/* セロハンテープ */
.photos figure::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 90px;
  height: 22px;
  margin-left: -45px;
  background: rgba(225, 215, 180, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.45) saturate(0.7) contrast(1.05) brightness(0.9);
  transition: filter 0.6s ease;
}

.photos li:hover figure { transform: rotate(0deg) scale(1.02); }
.photos li:hover img { filter: none; }

.photos figcaption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 10px;
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.6;
  color: #2e2822;
}

.photos figcaption::before {
  content: counter(photo, decimal-leading-zero);
  flex: none;
  font-family: var(--type);
  font-size: 13px;
  color: var(--blood);
}

/* ------------------------------------------------------------ hole */

.exit {
  position: relative;
  z-index: 1;
  margin-top: clamp(72px, 12vh, 120px);
  padding-bottom: 60px;
  text-align: center;
}

.hole {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.hole .pit {
  position: relative;
  width: 170px;
  height: 190px;
  border-radius: 48% 52% 46% 54% / 50% 46% 54% 50%;
  background:
    radial-gradient(circle at 50% 50%, #e8e6dc 0 3px, #9d9b92 5px, #1a1a17 10px, transparent 12px),
    repeating-radial-gradient(circle at 50% 50%, #0b0b0a 0 8px, #22221e 10px 12px, #0b0b0a 15px),
    #0b0b0a;
  box-shadow:
    0 0 0 6px #2c2b26,
    0 0 0 10px rgba(80, 70, 55, 0.5),
    inset 0 0 40px 10px #000;
  transition: transform 0.8s ease;
}

/* 穴の縁のひび割れ */
.hole .pit::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background:
    linear-gradient(30deg, transparent 48%, rgba(20, 20, 18, 0.9) 49% 51%, transparent 52%) 0 0 / 40px 30px no-repeat,
    linear-gradient(-60deg, transparent 48%, rgba(20, 20, 18, 0.9) 49% 51%, transparent 52%) 100% 10% / 36px 34px no-repeat,
    linear-gradient(80deg, transparent 48%, rgba(20, 20, 18, 0.9) 49% 51%, transparent 52%) 20% 100% / 30px 40px no-repeat;
  pointer-events: none;
}

.hole:hover .pit { transform: scale(1.12) rotate(12deg); }

.hole .label {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--text);
}

.hole:hover .label { color: #efe8d2; }

.copyright {
  margin-top: 32px;
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
}

@media (max-width: 480px) {
  .door { padding: 22px 16px 110px; }
  .door-knob { right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .photos figure, .photos img, .hole .pit { transition: none; }
}


/* ゲームの権利表記 */
.legal-note {
  max-width: 40em;
  margin: 0 auto 14px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
}
