/*
 * Global stylesheet for the DreamAlarm+ landing page and companion pages.
 *
 * This file establishes a clean, modern aesthetic inspired by Apple's design
 * language. It makes use of CSS variables to support light and dark themes
 * and defines consistent typography, spacing, and component styles across
 * all pages. The dark mode can be toggled via a small script that adds or
 * removes a `dark` class on the root element. Tables and details elements
 * are styled for readability, and the overall layout adapts gracefully to
 * smaller screens. No external frameworks are used – everything here is
 * plain CSS to ensure fast loading and compatibility.
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;600;700&display=swap');

/*
  Theme variables.  The base (light) palette draws from the off‑white
  backgrounds and subtle greys found on apple.com, with a vibrant blue
  accent colour used for interactive elements. Dark mode flips the
  background and foreground values while preserving contrast.
*/
:root {
  --color-bg: #f5f5f7;
  --color-bg-secondary: #ffffff;
  --color-light-grey: #e5e5ea;
  --color-text: #1d1d1f;
  --color-secondary-text: #6e6e73;
  --color-accent: #0071e3;
  --color-footer-bg: #f5f5f7;
  --spacing-section: 80px;
}

.dark {
  --color-bg: #1d1d1f;
  --color-bg-secondary: #141417;
  --color-light-grey: #2c2c30;
  --color-text: #f5f5f7;
  --color-secondary-text: #a1a1a6;
  --color-accent: #0a84ff;
  --color-footer-bg: #000;
  --spacing-section: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:focus,
a:hover {
  text-decoration: underline;
}

header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-light-grey);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar a.logo {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.navbar a.logo img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 8px;
}

.navbar nav {
  display: flex;
  align-items: center;
}

.navbar nav a {
  margin-left: 20px;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  text-decoration: none;
  padding-bottom: 4px;
}

.navbar nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

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

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  margin-left: 20px;
  color: var(--color-accent);
  padding: 8px;
}

main {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero section with an abstract dream background. An overlay darkens
   the background image so that white text remains legible. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-section) 20px;
  background-image: url('hero-bg.png');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  min-height: 60vh;
}

/* Background image element inside the hero section. Placing the
   decorative image as an <img> instead of using CSS background
   simplifies path resolution on local file systems. */
.hero img.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Lighter overlay to reveal more of the dreamy gradient */
  background: rgba(0, 0, 0, 0.15);
}

.hero > * {
  z-index: 1;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 30px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #004fa3;
  transform: translateY(-3px);
}

.section {
  padding: var(--spacing-section) 20px;
  background-color: var(--color-bg-secondary);
}

.section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--color-text);
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.feature-card {
  background-color: var(--color-bg);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.feature-card .icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.feature-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.feature-card p {
  margin-bottom: 0.5rem;
  color: var(--color-secondary-text);
}

.feature-card ul {
  padding-left: 1.2rem;
  color: var(--color-secondary-text);
  list-style-type: disc;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.persona-card {
  background-color: var(--color-bg);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.persona-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.persona-card h4 {
  color: var(--color-accent);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.persona-card p {
  color: var(--color-secondary-text);
  line-height: 1.5;
}

/* Story (experience) section */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.story-item {
  display: flex;
  align-items: flex-start;
}

.story-item:nth-child(even) {
  flex-direction: row-reverse;
}

.story-icon-wrapper {
  width: 50px;
  height: 50px;
  background-color: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  color: #ffffff;
  font-size: 1.3rem;
}

.story-item:nth-child(even) .story-icon-wrapper {
  margin-left: 20px;
  margin-right: 0;
}

.story-content {
  background-color: var(--color-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  color: var(--color-text);
  flex: 1;
}

.story-content h4 {
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  font-size: 1.2rem;
}

.story-content p {
  color: var(--color-secondary-text);
}

/* Tech stack cards */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.tech-card {
  background-color: var(--color-bg);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.tech-card:hover {
  transform: translateY(-4px);
}

.tech-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--color-accent);
}

.tech-card h4 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: var(--color-text);
}

.tech-card p {
  color: var(--color-secondary-text);
  font-size: 0.9rem;
}

/* Merits list */
.merit-list {
  display: grid;
  gap: 20px;
  list-style: none;
}

.merit-item {
  background-color: var(--color-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.merit-item:hover {
  transform: translateY(-4px);
}

.merit-item strong {
  display: block;
  font-size: 1.2rem;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.merit-item span {
  color: var(--color-secondary-text);
}

/* Pricing cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.pricing-card {
  background-color: var(--color-bg);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
}

.pricing-card h4 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--color-accent);
}

.pricing-card p {
  color: var(--color-secondary-text);
  margin-bottom: 0;
}

/* Tables used in privacy and other pages */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--color-light-grey);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--color-bg-secondary);
}

/* Details/summary for FAQ */
details {
  margin-bottom: 1rem;
  background-color: var(--color-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
}

details p {
  margin-top: 8px;
  color: var(--color-secondary-text);
}

/* Footer */
footer {
  background-color: var(--color-footer-bg);
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--color-light-grey);
}

.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  margin: 0 10px;
  color: var(--color-secondary-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-accent);
}

footer p {
  color: var(--color-secondary-text);
  font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .navbar nav a {
    margin-left: 12px;
  }
  #theme-toggle {
    margin-left: 12px;
  }
}

/*
  Elements tagged with the `reveal` class will fade and slide into view
  when scrolled into the viewport. The accompanying `visible` class is
  toggled by a small IntersectionObserver in index.html.
*/
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}