/* ========================================
   Context — Editorial Calm Design System
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FAFAF7;
  --bg-warm: #F4F3EE;
  --surface: #FFFFFF;
  --border: #E2E0D8;
  --border-light: #ECEAE3;
  --text: #1C1C1C;
  --text-secondary: #5C5C5C;
  --text-tertiary: #8A8A82;
  --accent: #1A6B5A;
  --accent-light: #E8F3F0;
  --accent-hover: #145A4A;
  --mono-bg: #F0EFEA;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

/* --- Scroll-Triggered Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.visible {
  animation: fadeUp 0.7s var(--ease-out) forwards;
}

/* stagger children */
.reveal-group .reveal:nth-child(1) { animation-delay: 0s; }
.reveal-group .reveal:nth-child(2) { animation-delay: 0.1s; }
.reveal-group .reveal:nth-child(3) { animation-delay: 0.2s; }
.reveal-group .reveal:nth-child(4) { animation-delay: 0.25s; }

/* --- Layout --- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Header / Nav --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.25s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  width: 100%;
}

.nav a.active {
  color: var(--text);
}

.nav a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Hero (Homepage) --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
  padding: 5rem 0 4rem;
}

.hero-content {
  padding-top: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  margin-bottom: 1.75rem;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 520px;
}

/* Hero sidebar — app identity */
.hero-aside {
  position: relative;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.hero-aside .app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 1.25rem;
}

.hero-aside p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-aside ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-aside li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 1.1rem;
  position: relative;
}

.hero-aside li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Button --- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 107, 90, 0.2);
}

.button:active {
  transform: translateY(0);
}

.button--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button--outline:hover {
  background: var(--accent-light);
  box-shadow: none;
  transform: translateY(-1px);
}

/* --- Section Titles --- */
.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 640px;
}

/* --- Sections --- */
.section {
  padding: 5rem 0;
}

.section--bordered {
  border-top: 1px solid var(--border-light);
}

.section--tinted {
  background: var(--bg-warm);
}

/* --- Feature Cards (Homepage) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 3rem;
}

.feature-cell {
  background: var(--surface);
  padding: 2.25rem;
  transition: background 0.3s ease;
}

.feature-cell:hover {
  background: var(--bg);
}

.feature-cell h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.feature-cell p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --- Two-Column Feature Row --- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  padding: 3rem 0;
}

.feature-row h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.feature-row p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Callout Block --- */
.callout {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 3rem;
  background: var(--surface);
  margin-top: 3rem;
}

.callout h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.callout p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Feature Page Hero --- */
.page-hero {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--border-light);
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.page-hero p {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 640px;
}

/* --- Feature Detail Cards --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.detail-card {
  padding: 2rem 0;
  border-top: 2px solid var(--border);
  transition: border-color 0.3s ease;
}

.detail-card:hover {
  border-top-color: var(--accent);
}

.detail-card h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.detail-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --- About Page --- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
}

.about-item {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.about-item h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.about-item p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Contact Form --- */
.form-wrap {
  max-width: 520px;
  margin-top: 3rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 107, 90, 0.08);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%235C5C5C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Divider Motif --- */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 4rem 0;
  color: var(--border);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.divider svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 3rem 0 2.5rem;
  }

  .hero-aside {
    max-width: 400px;
  }

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

  .feature-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .detail-card {
    border-top-width: 1px;
    padding: 1.5rem 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250, 250, 247, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .header-inner {
    position: relative;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .page-hero h1 {
    font-size: 1.75rem;
  }

  .section {
    padding: 3rem 0;
  }

  .callout {
    padding: 1.75rem;
  }

  .container {
    padding: 0 1.25rem;
  }
}
