/* Borema Digital — site styles */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #FAF9F6;
  --bg-alt: #F2F0EA;
  --ink: #0A1628;
  --ink-soft: #3A4A5C;
  --ink-muted: #6B7785;
  --rule: #D9D5CC;
  --accent: #0F7B6C;
  --accent-soft: #E8F0EE;
  --accent-strong: #084B43;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --max-w: 720px;
  --max-w-wide: 1040px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
}

/* --- Reset & base --- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(15,123,108,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(15,123,108,0.03) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

main, header, footer { position: relative; z-index: 1; }

/* --- Typography --- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--space-md) 0;
  line-height: 1.1;
  font-feature-settings: "ss01", "ss02";
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 300; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 400; margin-top: var(--space-lg); }
h3 { font-size: 1.25rem; font-weight: 500; margin-top: var(--space-md); margin-bottom: var(--space-sm); }
h4 { font-size: 1rem; font-weight: 500; margin-top: var(--space-md); margin-bottom: var(--space-xs); }

p {
  margin: 0 0 var(--space-sm) 0;
  color: var(--ink-soft);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  border-bottom-color: var(--accent);
}

a.plain {
  color: inherit;
}

a.plain:hover {
  color: var(--accent);
  border-bottom-color: transparent;
}

strong { font-weight: 500; color: var(--ink); }
em { font-style: italic; }

ul, ol {
  margin: 0 0 var(--space-sm) 0;
  padding-left: 1.4em;
  color: var(--ink-soft);
}

ul li, ol li { margin-bottom: 0.4em; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-lg) 0;
}

/* --- Layout primitives --- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  width: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: inline-block;
}

.lead {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
  letter-spacing: -0.005em;
}

.muted { color: var(--ink-muted); }
.small { font-size: 0.9rem; }

/* --- Header --- */

.site-header {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--rule);
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.logo:hover { border-bottom-color: transparent; color: var(--accent); }

.logo img {
  width: 150px;
  display: block;
}

.site-nav {
  display: flex;
  gap: var(--space-md);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-soft);
  font-weight: 400;
}

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

/* --- Footer --- */

.site-footer {
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0 var(--space-md) 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.site-footer .container-wide {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent); }

.site-footer nav {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* --- Page-specific --- */

.hero {
  padding: var(--space-xl) 0 var(--space-lg) 0;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero .lead {
  max-width: 540px;
}

.section {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--rule);
}

.section:first-of-type { border-top: none; }

.section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--space-xs);
}

/* App card on homepage */
.apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.app-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.app-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.app-card .icon {
  width: 80px;
  height: 80px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-card .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card .meta h3 {
  margin: 0 0 0.25rem 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
}

.app-card .meta p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.app-card .arrow {
  font-size: 1.2rem;
  color: var(--ink-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.app-card:hover .arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7em 1.4em;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  border-bottom-color: var(--accent);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-muted);
}

.btn.secondary:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Long-form content (privacy, terms) */
.prose h2 { margin-top: var(--space-lg); }
.prose h3 { margin-top: var(--space-md); }
.prose p, .prose ul, .prose ol { font-size: 0.95rem; }

/* Definition list (used in legal pages) */
.prose dl {
  margin: var(--space-md) 0;
}

.prose dt {
  font-weight: 500;
  color: var(--ink);
  margin-top: var(--space-sm);
}

.prose dd {
  margin: 0 0 var(--space-sm) 0;
  color: var(--ink-soft);
  padding-left: var(--space-md);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  body { font-size: 16px; }

  .site-header .container-wide {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .site-nav {
    gap: var(--space-sm);
    font-size: 0.9rem;
  }

  .app-card {
    grid-template-columns: 60px 1fr;
    gap: var(--space-sm);
  }

  .app-card .icon { width: 60px; height: 60px; }
  .app-card .arrow { display: none; }

  .hero { padding: var(--space-lg) 0 var(--space-md) 0; }
  .section { padding: var(--space-md) 0; }
}

/* --- Page load animation --- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
  }
  .hero .eyebrow { animation-delay: 0.05s; }
  .hero h1 { animation-delay: 0.15s; }
  .hero .lead { animation-delay: 0.3s; }
  .hero .actions { animation-delay: 0.45s; }
}

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