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

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #17161b;
  --muted: #6f6c66;
  --border: #e7e3da;
  --accent: #c8622d;
  --accent-soft: #f3e4d8;
  --shadow: rgba(23,22,27,0.06);
  --radius: 22px;
  --ease: cubic-bezier(.16,.84,.44,1);
}

[data-theme="dark"] {
  --bg: #0e0e10;
  --surface: #17171b;
  --text: #f3f1ec;
  --muted: #9a968d;
  --border: #26262b;
  --accent: #e8905a;
  --accent-soft: #2a2018;
  --shadow: rgba(0,0,0,0.45);
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
  cursor: default;
  line-height: 1.6;
}
h1, h2, h3 { font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: -0.02em; line-height: 1.25; }
.serif-em { font-family: 'Lora', serif; font-style: italic; font-weight: 500; color: var(--accent); line-height: 1.3; display: inline-block; }
.logo { font-family: 'Lora', serif; font-weight: 600; font-style: italic; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
p { color: var(--muted); }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; background: var(--bg); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .7s var(--ease), visibility .7s var(--ease);
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.pre-mark {
  font-family: 'Lora', serif; font-style: italic; font-size: 2.4rem; color: var(--accent);
  animation: preScale 1.2s var(--ease) infinite;
}
@keyframes preScale { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 13px 26px; border-radius: 100px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600; font-size: 0.92rem; line-height: 1.4; transition: transform .4s var(--ease), background-color .4s var(--ease), color .4s var(--ease);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-ghost { color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.magnetic { will-change: transform; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color .5s var(--ease), border-color .5s var(--ease);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.logo { font-size: 1.25rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.92rem; font-weight: 500; color: var(--muted); position: relative; transition: color .3s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; background: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  width: 44px; height: 24px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); position: relative; cursor: pointer; transition: background-color .5s var(--ease);
}
.theme-toggle .dot {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); transition: transform .45s var(--ease);
}
[data-theme="dark"] .theme-toggle .dot { transform: translateX(20px); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 20px; height: 1.5px; background: var(--text); }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 140px 0 60px; text-align: center; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); z-index: 0; animation: drift 10s ease-in-out infinite; }
.orb-1 { width: 420px; height: 420px; background: var(--accent); opacity: 0.18; top: 8%; left: 8%; }
.orb-2 { width: 340px; height: 340px; background: #7c88ff; opacity: 0.14; bottom: 10%; right: 10%; animation-delay: 3s; }
[data-theme="dark"] .orb { opacity: 0.25; filter: blur(90px); }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-20px); } }

.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500; font-size: 0.85rem; margin-bottom: 26px; letter-spacing: 0.02em; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-title { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; line-height: 1.25; }
.reveal-line { display: block; overflow: hidden; padding-bottom: 0.15em; margin-bottom: -0.15em; }
.reveal-line span { display: inline-block; transform: translateY(115%); animation: lineUp 1s var(--ease) forwards; }
.reveal-line:nth-child(1) span { animation-delay: .1s; }
.reveal-line:nth-child(2) span { animation-delay: .25s; }
.reveal-line:nth-child(3) span { animation-delay: .4s; }
@keyframes lineUp { to { transform: translateY(0); } }
.hero-sub { max-width: 480px; margin: 28px auto 36px; font-size: 1.05rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 14px; justify-content: center; }
.hero-meta { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 60px; color: var(--muted); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.82rem; letter-spacing: 0.03em; }

.reveal { opacity: 0; animation: fadeIn 1s var(--ease) forwards; animation-delay: .5s; }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Marquee ---------- */
.marquee { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; padding: 18px 0; white-space: nowrap; transition: border-color .5s var(--ease); }
.marquee-track { display: inline-flex; gap: 40px; animation: scrollX 26s linear infinite; }
.marquee-track span { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.9rem; color: var(--muted); }
@keyframes scrollX { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Scroll reveal (generic) ---------- */
.reveal[data-io] { animation: none; opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Sections ---------- */
section { padding: 130px 0; }
section[id] { scroll-margin-top: 100px; }
.section-tag { color: var(--accent); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 14px; }
.section-title { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; margin-bottom: 60px; max-width: 640px; line-height: 1.3; }

/* ---------- Bento grid ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px; gap: 18px; }
.bento-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; justify-content: center;
  transition: transform .45s var(--ease), border-color .4s var(--ease), background-color .5s var(--ease);
}
.bento-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.bento-lg { grid-column: span 2; grid-row: span 2; justify-content: space-between; }
.bento-wide { grid-column: span 2; }
.bento-kicker { color: var(--accent); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; }
.bento-card h3 { font-size: 1.3rem; line-height: 1.35; }
.bento-num { font-family: 'Lora', serif; font-size: 2.4rem; color: var(--text); line-height: 1.2; }
.bento-num-static { font-family: 'Lora', serif; font-style: italic; font-size: 2rem; color: var(--accent); line-height: 1.2; }
.bento-card p { margin-top: 6px; font-size: 0.9rem; line-height: 1.5; }
.bento-link { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; color: var(--accent); font-size: 0.9rem; }
.bento-wide p { color: var(--text); font-size: 1rem; line-height: 1.6; }

/* ---------- App Preview ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  column-gap: 24px;
  row-gap: 36px;
  align-items: start;
  margin-bottom: 26px;
}
.app-showcase {
  display: flex; gap: 30px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px;
  box-shadow: 0 10px 30px var(--shadow);
  transition: border-color .4s var(--ease), background-color .5s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease);
  position: relative;
  overflow: hidden;
}
.app-showcase:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(200, 98, 45, 0.12);
}
[data-theme="dark"] .app-showcase:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(232, 144, 90, 0.15);
}
.app-icon {
  flex-shrink: 0; width: 96px; height: 96px; border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 24px var(--shadow);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.app-showcase:hover .app-icon {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 16px 32px var(--shadow);
}
.app-icon img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.app-icon-fallback {
  background: linear-gradient(135deg, var(--accent), #6c8bff);
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.app-info { flex: 1; min-width: 0; }
.app-info h3 { font-size: 1.45rem; margin-bottom: 6px; line-height: 1.3; transition: color .3s var(--ease); }
.app-showcase:hover .app-info h3 { color: var(--accent); }
.app-meta { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.85rem; margin-bottom: 12px; }
.app-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 0.9rem; }
.stars { color: var(--accent); letter-spacing: 2px; }
.new-badge {
  background: var(--accent-soft); color: var(--accent); font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 100px; letter-spacing: 0.03em;
}

/* Extra details animated expand on hover */
.app-details-extra-wrapper {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: max-height .5s var(--ease), opacity .4s var(--ease), transform .45s var(--ease);
}
.app-showcase:hover .app-details-extra-wrapper,
.app-showcase:focus-within .app-details-extra-wrapper {
  max-height: 300px;
  opacity: 1;
  transform: translateY(0);
}
.app-details-extra {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.app-details-extra .app-desc {
  margin-bottom: 0;
  max-width: 480px;
  line-height: 1.6;
}
.app-cta-wrap {
  display: flex;
  padding-bottom: 4px;
}
.app-note { margin-top: 26px; text-align: center; font-size: 0.9rem; line-height: 1.6; }
.app-note a { color: var(--accent); font-weight: 600; }

@media (hover: none) {
  .app-details-extra-wrapper {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.process-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; transition: transform .45s var(--ease), border-color .4s var(--ease); }
.process-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.p-num { font-family: 'Lora', serif; color: var(--accent-soft); font-size: 1.6rem; font-weight: 700; -webkit-text-stroke: 1px var(--accent); display: block; margin-bottom: 16px; line-height: 1.2; }
.process-card h3 { margin-bottom: 8px; line-height: 1.3; }
.process-card p { font-size: 0.9rem; line-height: 1.5; }

/* ---------- Contact ---------- */
.contact { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-note { margin: 14px 0 30px; line-height: 1.6; }
.contact-list div { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.contact-list span { color: var(--muted); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.contact-list a { font-weight: 600; }
.contact-form { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: background-color .5s var(--ease), border-color .5s var(--ease); }
.contact-form input, .contact-form textarea {
  padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif; line-height: 1.5; transition: border-color .3s var(--ease);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 40px 0; border-top: 1px solid var(--border); transition: border-color .5s var(--ease); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-inner p { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.85rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-family: 'Plus Jakarta Sans', sans-serif; color: var(--muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-lg, .bento-wide { grid-column: span 2; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav-links {
    position: fixed; top: 78px; right: -100%; flex-direction: column;
    background: var(--bg); width: 70%; height: calc(100vh - 78px); padding: 40px 30px; gap: 26px;
    transition: right .5s var(--ease), background-color .5s var(--ease); border-left: 1px solid var(--border);
  }
  .nav-links.active { right: 0; }
  .nav-toggle { display: flex; }
  .header .btn-primary { display: none; }
  .bento-grid, .process-grid { grid-template-columns: 1fr; }
  .app-showcase { flex-direction: column; }
}
