:root {
  color-scheme: light;
  --ink: #281e1c;
  --muted: #716563;
  --red: #cf2026;
  --red-dark: #a91218;
  --red-soft: #fff1ef;
  --red-pale: #fff8f6;
  --line: #f0ded9;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(84, 30, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(207, 32, 38, 0.34);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  overflow: hidden;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(70, 44, 39, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 36px;
  object-fit: contain;
}

.brand b {
  color: var(--red);
}

.header-links {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
}

.contact-link {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.contact-link:hover {
  color: var(--red);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 42px;
  text-align: center;
}

.hero-visual-wrap {
  position: relative;
  z-index: 1;
  width: min(470px, 74vw);
  margin-bottom: 24px;
  animation: settle-in 720ms cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

.hero-visual-wrap::after {
  position: absolute;
  right: 12%;
  bottom: 0;
  left: 12%;
  height: 22px;
  background: rgba(66, 35, 30, 0.14);
  border-radius: 50%;
  content: "";
  filter: blur(16px);
  z-index: -1;
}

.hero-visual {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 17px 16px rgba(53, 26, 23, 0.08));
}

.hero-copy {
  position: relative;
  z-index: 1;
  animation: settle-in 720ms 100ms cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 6.7rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.hero h1 span,
.tagline strong {
  color: var(--red);
}

.tagline {
  margin: 28px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lead {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.8vw, 1.08rem);
  letter-spacing: 0.05em;
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(540px, 100%);
  min-height: 180px;
  margin-top: 42px;
  padding: 29px 32px 31px;
  background: var(--red-pale);
  border: 1px solid var(--line);
  border-radius: 20px;
  animation: settle-in 720ms 180ms cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

.auth-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 21px;
  text-align: center;
}

.auth-view h2 {
  margin: 0 0 7px;
  font-size: 1.08rem;
}

.auth-view p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.google-button-area {
  display: grid;
  width: 220px;
  min-height: 52px;
  place-items: center;
}

.google-button-area > * {
  grid-area: 1 / 1;
}

#googleSignInButton {
  transform: scale(1.16);
}

.auth-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  color: var(--muted);
  font-size: 0.74rem;
}

.auth-loading::before {
  width: 1em;
  height: 1em;
  box-sizing: border-box;
  border: 2px solid rgba(111, 119, 129, 0.22);
  border-top-color: currentColor;
  border-radius: 50%;
  content: "";
  animation: welcome-loading-spin 0.72s linear infinite;
}

@keyframes welcome-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-loading::before {
    animation-duration: 1.5s;
  }
}

.guest-entry {
  display: grid;
  width: min(320px, 100%);
  gap: 12px;
  place-items: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  color: #a29592;
  font-size: 0.7rem;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.guest-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 46px;
  padding: 0 22px;
  color: var(--red-dark);
  background: var(--white);
  border: 1px solid rgba(207, 32, 38, 0.3);
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.guest-button:hover {
  background: var(--red-soft);
  border-color: rgba(207, 32, 38, 0.58);
}

.guest-note {
  font-size: 0.7rem !important;
}

.auth-message {
  margin: 14px 0 0;
  color: var(--red-dark);
  font-size: 0.78rem;
  text-align: center;
}

.auth-message:empty {
  display: none;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
}

.user-greeting p {
  margin-bottom: 2px;
  font-size: 0.73rem;
}

.user-greeting strong {
  display: block;
  max-width: 230px;
  overflow: hidden;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar,
.user-avatar-fallback {
  width: 46px;
  height: 46px;
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(77, 33, 28, 0.14);
}

.user-avatar {
  object-fit: cover;
}

.user-avatar-fallback {
  display: grid;
  color: var(--white);
  background: linear-gradient(145deg, #e23a3f, #a80f15);
  font-size: 1rem;
  font-weight: 800;
  place-items: center;
}

.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 52px;
  padding: 0 23px;
  color: var(--white);
  background: linear-gradient(135deg, #df2b31, #b81319);
  border: 1px solid #b81319;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(191, 22, 28, 0.2);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.start-button:hover {
  box-shadow: 0 14px 30px rgba(191, 22, 28, 0.28);
  transform: translateY(-2px);
}

.start-button span {
  font-size: 1.2rem;
}

.features {
  padding: 0 max(24px, calc((100% - 1100px) / 2)) 88px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding-top: 34px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.feature-card img {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.site-footer {
  display: grid;
  padding: 30px 24px 28px;
  color: #a69a97;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  text-align: center;
  place-items: center;
}

.site-footer p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.09em;
}

.site-footer small {
  line-height: 1.7;
}

.site-footer a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--red);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes settle-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero {
    padding-top: 48px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero {
    width: min(100% - 32px, 1180px);
  }

  .site-header {
    min-height: 68px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand img {
    width: 38px;
    height: 30px;
  }

  .hero {
    padding: 42px 0 68px;
  }

  .hero-visual-wrap {
    width: min(360px, 84vw);
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 13vw, 3.35rem);
    white-space: nowrap;
  }

  .tagline {
    margin-top: 21px;
    font-size: clamp(1.2rem, 5.4vw, 1.35rem);
    white-space: nowrap;
  }

  .lead {
    max-width: 300px;
    margin-right: auto;
    margin-left: auto;
    line-height: 1.8;
  }

  .auth-panel {
    margin-top: 32px;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .auth-view,
  .signed-in-view {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .google-button-area {
    flex-basis: auto;
    width: 190px;
  }

  .user-greeting {
    text-align: left;
  }

  .start-button {
    width: 100%;
  }

  .guest-button {
    width: 100%;
  }

  .features {
    padding-top: 0;
    padding-bottom: 60px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    align-items: center;
    padding: 0 8px;
    text-align: left;
  }

  .feature-card img {
    width: 70px;
    height: 70px;
    margin: 0;
  }

  .feature-card h3 {
    font-size: 0.96rem;
  }

  .feature-card p {
    font-size: 0.78rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-visual-wrap,
  .hero-copy,
  .auth-panel {
    animation: none;
  }

  .start-button,
  .guest-button {
    transition: none;
  }
}
