/* =============================================
   Gramo by Equimeal — Apple-inspired Design System
   ============================================= */

:root {
  /* Apple palette */
  --white: #ffffff;
  --gray-bg: #f5f5f7;
  --black: #000000;
  --ink: #1d1d1f;
  --gray-text: #86868b;
  --gray-border: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --green: #68cc45;
  --orange: #ff9f0a;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Inter, Arial, sans-serif;

  --nav-h: 52px;
  --container: 1080px;
  --container-wide: 1280px;
  --section-pad: 110px;
  --radius-lg: 28px;
  --radius-md: 18px;

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; border: none; cursor: pointer; background: none; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 19px;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.eyebrow.blue { color: var(--blue); }

.h-hero {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.h-section {
  font-size: clamp(32px, 4.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.h-sub {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 400;
  color: var(--gray-text);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 19px;
  color: var(--gray-text);
  line-height: 1.6;
  max-width: 680px;
}

/* ---------- Links & Buttons ---------- */
.link-chevron {
  color: var(--link);
  font-size: 19px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color 0.25s var(--ease);
}
.link-chevron::after {
  content: "›";
  font-size: 1.15em;
  line-height: 1;
  transform: translateY(-1px);
}
.link-chevron:hover { text-decoration: underline; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  font-size: 17px;
  font-weight: 400;
  border-radius: 980px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-outline {
  color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e8e8ed; }

/* ---------- Navigation (Apple frosted bar) ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(22, 22, 23, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.4s var(--ease);
}

.nav-container {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  color: #f5f5f7;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.nav-logo small {
  font-size: 11px;
  font-weight: 400;
  color: #a1a1a6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-link {
  color: #d6d6d9;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -17px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.menu-toggle span {
  width: 20px; height: 1.6px;
  background: #f5f5f7;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 64px) 22px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--gray-bg);
  overflow: hidden;
}
.hero .h-hero { color: var(--ink); }
.hero-tagline {
  font-size: clamp(21px, 2.6vw, 28px);
  color: var(--gray-text);
  margin-top: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hero-links { display: flex; gap: 34px; margin-top: 26px; }
.hero-media {
  margin-top: 56px;
  width: min(860px, 92vw);
}
.hero-media img {
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.14);
}
.hero.anim .h-hero,
.hero.anim .hero-tagline,
.hero.anim .hero-links,
.hero.anim .hero-media {
  opacity: 0;
  animation: rise 1s var(--ease) forwards;
}
.hero.anim .hero-tagline { animation-delay: 0.12s; }
.hero.anim .hero-links { animation-delay: 0.24s; }
.hero.anim .hero-media { animation-delay: 0.38s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(34px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page hero (subpages) */
.page-hero {
  padding: calc(var(--nav-h) + 96px) 22px 88px;
  text-align: center;
  background: var(--gray-bg);
}
.page-hero.dark { background: var(--black); color: #f5f5f7; }
.page-hero .h-sub { margin: 18px auto 0; max-width: 720px; }

/* ---------- Sections ---------- */
.section { padding: var(--section-pad) 22px; }
.section.gray { background: var(--gray-bg); }
.section.dark { background: var(--black); color: #f5f5f7; }
.section.dark .h-section { color: #f5f5f7; }
.section.dark .lede { color: #a1a1a6; }

.container { max-width: var(--container); margin: 0 auto; }
.container.wide { max-width: var(--container-wide); }

.section-head { text-align: center; max-width: 780px; margin: 0 auto 64px; }
.section-head .h-sub { margin-top: 16px; }
.section-head.left { text-align: left; margin-left: 0; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--gray-bg);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
}
.section.gray .card { background: var(--white); }

.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 22px;
  background: var(--ink);
  color: #fff;
}
.card h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.card p { font-size: 16px; color: var(--gray-text); line-height: 1.55; }

/* Dark cards */
.section.dark .card { background: #161617; }
.section.dark .card h3 { color: #f5f5f7; }
.section.dark .card p { color: #a1a1a6; }
.section.dark .card-icon { background: #f5f5f7; color: #000; }

/* ---------- Split feature rows ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split .media img { border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(0,0,0,0.12); }
.split .copy .h-section { margin-bottom: 18px; }
.split .copy .lede { margin-bottom: 26px; }

.check-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  font-size: 17px;
  color: var(--ink);
}
.check-list li::before {
  content: "";
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--blue) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/11px no-repeat;
}
.section.dark .check-list li { color: #d6d6d9; }

/* ---------- Stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat .num {
  font-size: clamp(44px, 5.4vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .num em { font-style: normal; font-size: 0.55em; }
.stat p { margin-top: 10px; font-size: 15px; color: var(--gray-text); }
.section.dark .stat p { color: #a1a1a6; }

/* ---------- Big image banner ---------- */
.banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.banner img { width: 100%; }
.banner .caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.55));
  color: #fff;
}
.banner .caption h3 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.02em; }
.banner .caption p { margin-top: 8px; font-size: 17px; color: rgba(255,255,255,0.85); max-width: 520px; }

/* ---------- Timeline ---------- */
.timeline { max-width: 720px; margin: 0 auto; }
.t-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--gray-border);
}
.t-item:last-child { border-bottom: none; }
.t-item .t-date { font-size: 15px; font-weight: 600; color: var(--blue); }
.t-item h4 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.t-item p { font-size: 16px; color: var(--gray-text); }

/* ---------- Team ---------- */
.member {
  background: var(--gray-bg);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.member:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,0,0,0.1); }
.avatar {
  width: 96px; height: 96px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
}
.member:nth-child(3n+2) .avatar { background: linear-gradient(135deg, #ff9f0a, #ff453a); }
.member:nth-child(3n) .avatar { background: linear-gradient(135deg, #30d158, #64d2ff); }
.member h3 { font-size: 21px; font-weight: 600; }
.member .role { font-size: 14px; color: var(--blue); font-weight: 500; margin: 4px 0 12px; }
.member p { font-size: 15px; color: var(--gray-text); line-height: 1.55; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--white);
}
table.spec th, table.spec td {
  text-align: left;
  padding: 16px 22px;
  border-bottom: 1px solid #e8e8ed;
}
table.spec th {
  font-weight: 600;
  color: var(--gray-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gray-bg);
}
table.spec tr:last-child td { border-bottom: none; }
table.spec td:first-child { font-weight: 500; }
.section.dark table.spec { background: #161617; }
.section.dark table.spec th { background: #1d1d1f; color: #a1a1a6; }
.section.dark table.spec td { border-color: #2c2c2e; color: #d6d6d9; }

/* Comparison highlight */
.hl-win { color: var(--green); font-weight: 600; }

/* ---------- Architecture flow ---------- */
.flow {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.flow .node {
  flex: 1 1 160px;
  max-width: 220px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.flow .node .n-icon { font-size: 26px; margin-bottom: 10px; }
.flow .node h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.flow .node p { font-size: 13px; color: var(--gray-text); line-height: 1.45; }
.flow .arrow {
  align-self: center;
  color: var(--gray-border);
  font-size: 22px;
  flex: 0 0 auto;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.g-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  grid-column: span 2;
  aspect-ratio: 1;
}
.g-item.wide { grid-column: span 3; aspect-ratio: auto; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.g-item:hover img { transform: scale(1.04); }
.g-item .g-tag {
  position: absolute;
  left: 16px; bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.g-item.tile {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px; color: #fff;
}
.g-item.tile h4 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.g-item.tile p { font-size: 13px; opacity: 0.85; margin-top: 4px; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--gray-border); }
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 4px;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  transition: color 0.25s;
}
.faq-q:hover { color: var(--blue); }
.faq-q .fx { font-size: 24px; font-weight: 300; color: var(--gray-text); transition: transform 0.35s var(--ease); }
.faq-item.open .faq-q .fx { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease);
}
.faq-a p { padding: 0 4px 24px; font-size: 16px; color: var(--gray-text); line-height: 1.6; max-width: 640px; }

/* ---------- Contact form ---------- */
.form { max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.form input:focus, .form textarea:focus, .form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { justify-self: start; border: none; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .h-section { margin-bottom: 16px; }
.cta .h-sub { margin-bottom: 34px; }
.cta .row { display: flex; gap: 30px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  background: var(--gray-bg);
  padding: 48px 22px 34px;
  font-size: 13px;
  color: var(--gray-text);
}
.footer .container { max-width: var(--container); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--gray-border);
}
.footer h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}
.footer-links li { margin-bottom: 8px; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-brand .nav-logo { color: var(--ink); margin-bottom: 10px; }
.footer-brand .nav-logo small { color: var(--gray-text); }
.footer-brand p { line-height: 1.6; max-width: 300px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
}
.footer-bottom a:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero.anim * { animation: none !important; opacity: 1 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --section-pad: 76px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split .media { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .g-item, .g-item.wide { grid-column: span 1; aspect-ratio: 1; }

  .menu-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(22, 22, 23, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 12px 30px 26px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .nav-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-menu li { width: 100%; }
  .nav-link { display: block; padding: 14px 0; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-link.active::after { display: none; }
  .menu-toggle.open span:nth-child(1) { transform: translateY(3.3px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { transform: translateY(-3.3px) rotate(-45deg); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .t-item { grid-template-columns: 1fr; gap: 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-links { gap: 22px; }
  .card { padding: 34px 26px; }
}
