/* ==============================================
   MapleKingdom - Japanese Maple Theme
   Warm cream base, maple-red accents, restrained
   typography that nods to Japanese print design.
   ============================================== */

/* --- Variables --- */
:root {
  --bg: #FBF6F0;            /* warm cream / parchment */
  --bg-card: #FFFFFF;
  --bg-accent: #F5EBDF;     /* deeper cream for sections */
  --bg-ink: #1F1812;        /* dark mode panels (footer) */

  --accent: #B23A2E;        /* Japanese maple leaf red */
  --accent-hover: #8E2A20;  /* deep crimson */
  --accent-light: rgba(178, 58, 46, 0.08);
  --accent-soft: #D9695B;   /* softer red for hovers / subtle */

  --wood: #A87655;          /* maple wood mid-tone, used sparingly */
  --wood-dark: #6B4A33;     /* darker grain */

  --text: #2A2118;          /* warm near-black */
  --text-secondary: #4A3F35;
  --text-muted: #786659;

  --highlight: #2E7D5B;     /* moss green - garden complement to red */

  --border: #EDE2D5;        /* pale parchment line */
  --border-strong: #D9C8B3;

  --shadow: 0 4px 14px rgba(60, 30, 15, 0.06);
  --shadow-lg: 0 10px 28px rgba(60, 30, 15, 0.10);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 18px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Times New Roman', serif;

  --max-width: 1200px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}
h1 { font-size: 2.75rem; }
h2 { font-size: 2.125rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.0625rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.highlight {
  color: var(--highlight);
  font-weight: 500;
}

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

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
main { padding-top: var(--header-height); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(178, 58, 46, 0.28);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.0625rem;
}

/* ================================================
   HEADER & NAVIGATION
   ================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(251, 246, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
.navbar { height: 100%; }
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.brand-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-mark {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
  border-radius: 2px;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link.active::after { transform: scaleX(1); }
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 101;
}
.nav-toggle .hamburger {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
  border-radius: 2px;
}
.nav-toggle.active .hamburger:nth-child(1) { transform: rotate(-45deg) translate(-5px, 5px); }
.nav-toggle.active .hamburger:nth-child(2) { opacity: 0; }
.nav-toggle.active .hamburger:nth-child(3) { transform: rotate(45deg) translate(-5px, -5px); }


/* ================================================
   HOMEPAGE - HERO
   ================================================ */
.hero {
  padding: 5.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 1.25rem;
}
.hero-content h1 {
  font-size: 4rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.015em;
}
.hero-content h1 .accent-word {
  color: var(--accent);
}
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 36rem;
}
.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Decorative maple leaf cluster (pure CSS / SVG-ready container) */
.maple-cluster {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.maple-cluster svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 30px rgba(178, 58, 46, 0.15));
}


/* ================================================
   SECTION SCAFFOLDING
   ================================================ */
.section { padding: 4.5rem 0; }
.section-on-cream { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-tight { padding: 3rem 0; }

.section-title {
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: 2.5rem;
  line-height: 1.15;
}
.section-subtitle {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 3rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}


/* ================================================
   HOMEPAGE - INTRO BLOCK
   ================================================ */
.intro-block {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.intro-block h2 { margin-bottom: 1.25rem; }


/* ================================================
   APPS GRID (homepage spotlight + apps page)
   ================================================ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-soft);
  color: inherit;
}
.app-card-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
}
.app-card-status.coming-soon {
  background: rgba(120, 102, 89, 0.1);
  color: var(--text-muted);
}
.app-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 1rem;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 600;
}
.app-card h3 { margin-bottom: 0.5rem; font-size: 1.375rem; }
.app-card-tagline {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  flex-grow: 1;
}
.app-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}
.app-card-meta .arrow {
  color: var(--accent);
  font-weight: 600;
  transition: transform 0.2s;
}
.app-card:hover .app-card-meta .arrow { transform: translateX(3px); }


/* ================================================
   APP DETAIL PAGE (e.g. /apps/wordsen/)
   ================================================ */
.app-detail-hero {
  padding: 5rem 0 3rem;
  background: var(--bg-accent);
  border-bottom: 1px solid var(--border);
}
.app-detail-hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.app-detail-hero .eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.75rem;
}
.app-detail-hero h1 { font-size: 3.5rem; margin-bottom: 1rem; }
.app-detail-hero p { font-size: 1.125rem; max-width: 32rem; }
.app-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.app-detail-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.app-detail-content { padding: 4rem 0; }
.app-detail-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}
.app-detail-content h2:first-child { margin-top: 0; }
.app-detail-content > .container > p,
.app-detail-content > .container > ul {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.app-detail-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}
.app-detail-content ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.app-detail-content ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7rem;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}


/* ================================================
   PHONE FRAME COMPONENT (carried from WordSen)
   ================================================ */
.phone-frame {
  position: relative;
  display: inline-block;
  background: #1a1a1a;
  border-radius: 44px;
  padding: 10px;
  box-shadow:
    0 25px 60px rgba(60, 30, 15, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}
.phone-screen {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 19.5;
  width: 280px;
}
.phone-screen img,
.phone-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 25px;
  background: #1a1a1a;
  border-radius: 13px;
  z-index: 2;
}
.phone-screen-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  text-align: center;
  padding: 2rem;
}
@media (max-width: 768px) {
  .phone-frame { border-radius: 36px; padding: 8px; }
  .phone-screen { border-radius: 28px; width: 220px; }
  .phone-notch { width: 68px; height: 20px; top: 8px; border-radius: 10px; }
}


/* ================================================
   PAGE HEADER (subpages)
   ================================================ */
.page-header {
  padding: 4rem 0 2.5rem;
  text-align: center;
  background: var(--bg-accent);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  margin-bottom: 0.75rem;
  font-size: 3rem;
}
.page-header p {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.0625rem;
  color: var(--text-secondary);
}


/* ================================================
   ABOUT PAGE
   ================================================ */
.about-content { padding: 4rem 0; }
.about-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.about-body h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
}
.about-body h2:first-child { margin-top: 0; }
.about-body p { margin-bottom: 1.25rem; }
.about-body ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.about-body li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.about-pull {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.5;
}


/* ================================================
   CONTACT
   ================================================ */
.contact-content { padding: 3rem 0 5rem; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 980px;
  margin: 0 auto;
}
.contact-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.contact-form h3 { margin-bottom: 1.25rem; font-size: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-note {
  text-align: center;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.contact-info h3 { margin-bottom: 1rem; font-size: 1.25rem; }
.contact-info p { margin-bottom: 1rem; }
.contact-method {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-method h4 { margin-bottom: 0.25rem; font-size: 1rem; }
.contact-method p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.9375rem;
}


/* ================================================
   LEGAL / SUPPORT BODY (privacy, terms, support)
   ================================================ */
.legal-content { padding: 3rem 0 5rem; }
.legal-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.legal-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.legal-body h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.legal-body h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font);
  font-weight: 600;
}
.legal-body p { margin-bottom: 1rem; }
.legal-body ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.legal-body li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
}
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body code {
  background: var(--bg-accent);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', monospace;
}
.legal-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}


/* ================================================
   FOOTER
   ================================================ */
.site-footer {
  background: var(--bg-ink);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    var(--wood) 50%,
    var(--accent) 100%
  );
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  gap: 3rem;
  flex-wrap: wrap;
}
.footer-brand h3 {
  color: #fff;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
  font-family: var(--font-display);
}
.footer-brand p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
  margin: 0;
  max-width: 22rem;
}
.footer-links { display: flex; gap: 3rem; }
.footer-column h4 {
  color: #fff;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 0.5rem; }
.footer-column ul li a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9375rem;
  transition: color 0.2s;
}
.footer-column ul li a:hover { color: var(--accent-soft); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
}
.footer-bottom p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8125rem;
  margin: 0;
}


/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
  h1 { font-size: 2.25rem; }
  .hero-content h1 { font-size: 3rem; }
  .app-detail-hero h1 { font-size: 2.5rem; }
  .page-header h1 { font-size: 2.25rem; }
  .section-title { font-size: 2rem; }
  .hero .container,
  .app-detail-hero .container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-cta, .app-detail-actions { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-height); left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(251, 246, 240, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2rem;
    gap: 1.5rem;
    z-index: 99;
  }
  .nav-menu.active { display: flex; }
  .nav-menu .nav-link { font-size: 1.25rem; }
  .nav-toggle { display: flex; }

  .hero { padding: 2.5rem 0 3rem; }
  .hero-content h1 { font-size: 2.5rem; }
  .footer-content { flex-direction: column; gap: 2rem; }
  .footer-links { gap: 2rem; flex-wrap: wrap; }

  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero-content h1 { font-size: 2rem; }
  .section-title { font-size: 1.75rem; }
  .btn-large { padding: 0.875rem 2rem; }
}
