/* ==========================================================================
   Codeally — Minimal modern studio
   Typography: Geist + Geist Mono (sans only, no serif)
   Layout: centered, balanced, Linear/Notion-adjacent
   ========================================================================== */

:root {
  /* Color — light */
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --text: #0a0a0a;
  --text-muted: #6f6f6f;
  --border: #ebebeb;
  --border-strong: #d4d4d4;
  --primary: #38c5cd;

  --header-bg: rgba(250, 250, 250, 0.72);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Layout */
  --container-max: 1100px;
  --gutter: clamp(1.25rem, 3vw, 2rem);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-body: "Geist", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #121212;
  --text: #fafafa;
  --text-muted: #a0a0a0;
  --border: #1f1f1f;
  --border-strong: #2e2e2e;

  --header-bg: rgba(10, 10, 10, 0.65);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.625rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Typography */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(2rem, 3.8vw, 2.875rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  text-wrap: balance;
}

.section-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin-top: 0.75rem;
}

.muted-sm {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header — clean top nav, subtle border on scroll */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

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

.nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.875rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
}

.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
}

#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#theme-toggle:hover {
  background: var(--bg-elev);
  border-color: var(--border-strong);
}

.sun {
  display: none;
}
.moon {
  display: block;
}
[data-theme="dark"] .sun {
  display: block;
}
[data-theme="dark"] .moon {
  display: none;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hero */
.hero {
  padding: clamp(140px, 18vh, 200px) 0 clamp(80px, 12vh, 120px);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .eyebrow {
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2.25rem;
  line-height: 1.55;
}

.cta-group {
  display: inline-flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease;
  letter-spacing: 0;
  min-height: 40px;
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}

.btn.primary:hover {
  background: #262626;
  border-color: #262626;
}

[data-theme="dark"] .btn.primary:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
}

.btn.primary:active,
.btn.secondary:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

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

/* Sections */
section {
  padding: clamp(64px, 10vh, 120px) 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(3rem, 6vh, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-header .eyebrow {
  margin-bottom: 1rem;
}

.section-header .section-lead {
  margin-top: 0.75rem;
}

/* About — 2 equal columns, calm */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.about-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.about-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.about-card h3 {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.about-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Services — full-width list, simplified */
.services-list {
  list-style: none;
  max-width: 960px;
  margin: 0 auto;
}

.service-item {
  display: grid;
  grid-template-columns: 56px 1fr minmax(240px, 1fr) 32px;
  column-gap: clamp(0.75rem, 2vw, 2rem);
  align-items: center;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  transition: border-top-color 0.25s ease, padding 0.3s var(--ease);
}

.service-item:last-child {
  border-bottom: 1px solid var(--border);
}

.service-item .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.service-title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.service-body > p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 44ch;
}

.service-item .arrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  justify-self: end;
  transition: transform 0.25s var(--ease), color 0.2s ease;
}

.service-item:hover {
  border-top-color: var(--border-strong);
}

.service-item:hover .arrow {
  transform: translateX(6px);
  color: var(--text);
}

/* Contact — centered, no card */
.contact {
  padding: clamp(80px, 14vh, 140px) 0 clamp(64px, 10vh, 100px);
  text-align: center;
}

.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-inner .eyebrow {
  margin-bottom: 1rem;
}

.contact-inner .section-lead {
  margin-bottom: 2.5rem;
  text-align: center;
}

.email-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 0.2em;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.email-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Footer */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-content p,
.footer-content a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.footer-content a {
  transition: color 0.2s ease;
}

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

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Mobile */
@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

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

  .service-item {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "num title"
      ".   body";
    row-gap: 0.5rem;
    column-gap: 0.75rem;
  }

  .service-item .num {
    grid-area: num;
    align-self: start;
    padding-top: 0.35rem;
  }

  .service-title {
    grid-column: 2 / 3;
  }

  .service-body {
    grid-area: body;
    grid-column: 2 / 3;
  }

  .service-item > div {
    grid-column: 2 / 3;
  }

  .service-item .arrow {
    display: none;
  }
}
