/* ============================================
   SmartML — Complete Stylesheet

   Type scale (strict):
     17px  — meta (cite, role, back-link, copyright, buttons, counters)
     20px  — body (paragraphs, nav, lists, cards, bios)
     24px  — subhead (h3, h4, card-client)
     clamp(28px, 3.5vw, 38px) — h2, quotes
     clamp(40px, 5.5vw, 60px) — h1 (page titles)
     clamp(48px, 11vw, 108px) — display (contact headline)
     clamp(24px, 3vw, 34px)   — hero body (index only)

   Layout: ONE container width. Text measure on
   individual elements, not wrappers.
   ============================================ */

/* ── Fonts ── */
@font-face {
  font-family: 'Cloneroundedpeweb lt';
  src: url('../assets/fonts/CloneRoundedPEWeb-Lt.woff2') format('woff2'),
       url('../assets/fonts/CloneRoundedPEWeb-Lt.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cloneroundedpeweb sb';
  src: url('../assets/fonts/CloneRoundedPEWeb-Sb.woff2') format('woff2'),
       url('../assets/fonts/CloneRoundedPEWeb-Sb.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Tokens ── */
:root {
  --black: #0a0a0a;
  --white: #fff;
  --off-white: #f7f6f4;

  --teal: #2e8ab4;
  --teal-dark: #1f6f90;
  --amber: rgb(200, 150, 70);

  --dk-text: rgba(255, 255, 255, 0.5);
  --dk-text-strong: rgba(255, 255, 255, 0.92);
  --dk-border: rgba(255, 255, 255, 0.08);

  --lt-text: #4a4a4a;
  --lt-heading: #1a1a1a;
  --lt-muted: #999;
  --lt-border: #e2e1de;

  --font-display: 'Cloneroundedpeweb lt', sans-serif;
  --font-display-sb: 'Cloneroundedpeweb sb', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --container: 900px;
  --gutter: 24px;
  --text-measure: 640px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.75;
  color: var(--lt-text);
  background: var(--black);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; display: flex; flex-direction: column; }

::selection {
  background: var(--teal);
  color: var(--white);
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--lt-heading);
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-family: var(--font-display-sb);
  font-size: clamp(40px, 5.5vw, 60px);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-display-sb);
  font-size: 24px;
}

h4 {
  font-family: var(--font-display-sb);
  font-size: 20px;
}

p { margin: 0; }

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--teal-dark); }

strong { color: var(--lt-heading); font-weight: 600; }
img { max-width: 100%; display: block; }

/* ── Container (shared horizontal alignment) ── */
.container,
.header-inner,
.hero-inner,
.footer-container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.reading-area {
  background: var(--off-white);
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.07s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.16s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.32s; }

/* ── Cursor Glow ── */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 138, 180, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s;
  opacity: 0;
}
.cursor-glow.active { opacity: 1; }

/* ── Dot Grid ── */
.hero-grid {
  position: absolute;
  inset: 0;
  background: url('../assets/images/grid.svg') repeat;
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 60% 60% at 40% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 40% 50%, black, transparent);
}

/* ============================================
   Header
   ============================================ */
.site-header {
  background: var(--black);
  border-bottom: 1px solid rgba(46, 138, 180, 0.15);
  position: relative;
  z-index: 100;
}

.header-inner {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 32px;
}

.logo {
  flex-shrink: 0;
  line-height: 0;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.6; }

.logo img {
  height: 110px;
  width: auto;
  filter: invert(1);
  clip-path: inset(0 100% 0 0);
  animation: logo-reveal 1.2s cubic-bezier(0.22, 0.6, 0.2, 1) 0.2s forwards;
}

@keyframes logo-reveal {
  to { clip-path: inset(0 0 0 0); }
}

.nav-menu {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links li { margin: 0; }

.nav-links a {
  color: var(--dk-text);
  font-family: var(--font-display);
  font-size: 20px;                          /* body */
  padding: 8px 14px;
  display: block;
  position: relative;
  transition: color 0.15s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--teal);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
  transform-origin: left;
}
.nav-links a:hover { color: var(--dk-text-strong); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--dk-text-strong); }
.nav-links a.active::after { transform: scaleX(1); }


.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--dk-text-strong);
  margin: 4px auto;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(46, 138, 180, 0.15);
}

.footer-container {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-nav {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.footer-nav li { margin: 0; }

.footer-nav a {
  color: var(--dk-text);
  font-family: var(--font-display);
  font-size: 17px;                          /* meta */
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--dk-text-strong); }

.footer-divider { display: none; }

.footer-copyright {
  color: var(--teal);
  font-size: 17px;                          /* meta */
  margin: 0;
  white-space: nowrap;
}

.footer-copyright .copyright-symbol {
  color: var(--amber);
}

/* ============================================
   Page Header (inner pages)
   ============================================ */
.page-header {
  margin-bottom: 48px;
}

.page-header h1 {
  margin: 0;
}

/* ============================================
   Hero — Home (dark, immersive)
   ============================================ */
.hero {
  background: var(--black);
  position: relative;
  overflow: hidden;
  flex: 1;
}

.hero-inner {
  padding-top: 120px;
  padding-bottom: 100px;
  position: relative;
  z-index: 1;
}

.hero-text {
  max-width: 640px;
}

.hero-text h1 {
  color: var(--dk-text-strong);
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  line-height: 1.05;
}

.hero-text p {
  font-size: clamp(24px, 3vw, 34px);      /* hero body */
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 48px;
}

/* Hero link */
.hero-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 20px;                          /* body */
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.hero-link:hover {
  color: var(--white);
  border-color: var(--white);
}

/* Cellular Automaton Canvas */
.ca-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  mask-image: linear-gradient(to top, black, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, black, transparent 80%);
}

/* ============================================
   Rich Text
   ============================================ */
.rich-text p {
  max-width: var(--text-measure);
  margin-bottom: 24px;
  line-height: 1.85;
}

.rich-text h2 {
  margin-top: 56px;
  margin-bottom: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--lt-border);
}

.rich-text h3,
.rich-text h4 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.rich-text ul,
.rich-text ol {
  margin: 16px 0 24px;
  padding-left: 32px;
}

.rich-text li {
  margin-bottom: 8px;
  max-width: var(--text-measure);
}

/* Pull quote — uses h2 scale */
.quote-block {
  margin: 56px 0 48px;
  padding: 24px 0 0;
  border-top: 2px solid var(--teal);
  max-width: var(--text-measure);
}

.quote-block p {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);     /* h2 */
  line-height: 1.4;
  color: var(--lt-heading);
  margin: 0;
  max-width: none;
}

.quote-block cite {
  display: block;
  margin-top: 16px;
  font-size: 17px;                          /* meta */
  font-style: normal;
  font-family: var(--font-body);
  color: var(--lt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

blockquote {
  margin: 48px 0;
  padding: 24px 0 0;
  border-top: 2px solid var(--teal);
  max-width: var(--text-measure);
}
blockquote p {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);     /* h2 */
  line-height: 1.4;
  color: var(--lt-heading);
  max-width: none;
}
blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 17px;                          /* meta */
  font-style: normal;
  font-family: var(--font-body);
  color: var(--lt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Capability list */
.capability-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 32px;
  max-width: var(--text-measure);
}

.capability-list li {
  font-size: 20px;                          /* body */
  padding: 12px 0 12px 20px;
  position: relative;
  border-bottom: 1px solid var(--lt-border);
  margin: 0;
  max-width: none;
}
.capability-list li:first-child {
  border-top: 1px solid var(--lt-border);
}

.capability-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
}

/* ============================================
   Case Study List
   ============================================ */
.case-list {
  border-top: 1px solid var(--lt-border);
}

.case-item {
  display: flex;
  align-items: baseline;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--lt-border);
  text-decoration: none;
  color: var(--lt-text);
  transition: padding-left 0.3s var(--ease-out);
}
.case-item:hover {
  padding-left: 12px;
  color: var(--lt-text);
}

.case-client {
  font-family: var(--font-display-sb);
  font-size: 24px;                          /* subhead */
  color: var(--lt-heading);
  line-height: 1.3;
  flex-shrink: 0;
  width: 240px;
  margin: 0;
  border: none;
  padding: 0;
}

.case-item p {
  font-size: 20px;                          /* body */
  line-height: 1.7;
  flex: 1;
  margin: 0;
  max-width: var(--text-measure);
  color: var(--lt-text);
}

.case-arrow {
  font-size: 24px;                          /* subhead */
  color: var(--lt-muted);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.3s var(--ease-out);
}
.case-item:hover .case-arrow {
  color: var(--teal);
  transform: translateX(4px);
}
.case-item:hover .case-client {
  color: var(--teal);
}

/* ============================================
   Team
   ============================================ */
.team-grid {
  display: flex;
  flex-direction: column;
}

.team-member {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--lt-border);
}
.team-member:first-child {
  border-top: 1px solid var(--lt-border);
}

.team-member img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(100%);
  transition: filter 0.6s var(--ease-smooth);
}
.team-member:hover img { filter: grayscale(0%); }

.team-member-info { flex: 1; min-width: 0; }

.team-member h3 {
  margin: 0 0 4px;
  font-size: 24px;                          /* subhead */
}

.team-member .role {
  display: block;
  font-family: var(--font-body);
  font-size: 17px;                          /* meta */
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.team-member p {
  font-size: 20px;                          /* body */
  line-height: 1.75;
  max-width: var(--text-measure);
  margin: 0;
}

/* ============================================
   Phases / Timeline
   ============================================ */
.phases { counter-reset: phase; }

.phase {
  counter-increment: phase;
  padding: 24px 0;
  border-bottom: 1px solid var(--lt-border);
}
.phase:last-child { border-bottom: none; }

.phase h3 {
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}

.phase h3::before {
  content: counter(phase);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--teal);
  color: var(--teal);
  font-family: var(--font-display-sb);
  font-size: 17px;                          /* meta */
  border-radius: 50%;
  flex-shrink: 0;
}

.phase p {
  padding-left: 40px;
  max-width: var(--text-measure);
}

/* ============================================
   Specs
   ============================================ */
.specs { margin-top: 48px; }
.specs h2 { margin-bottom: 24px; }

.specs-grid {
  display: flex;
  gap: 48px;
}

.spec-block {
  flex: 1;
  padding: 0;
}

.spec-block h3 {
  margin: 0 0 16px;
  font-size: 24px;                          /* subhead */
  padding-bottom: 12px;
  border-bottom: 2px solid var(--teal);
}

.spec-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spec-block li {
  font-size: 17px;                          /* meta */
  padding: 8px 0 8px 16px;
  position: relative;
  margin: 0;
  max-width: none;
}

.spec-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15px;
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
}

/* ============================================
   Contact — dark, centered
   ============================================ */
body.no-scroll {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contact-hero {
  background: var(--black);
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.contact-hero .container {
  position: relative;
  z-index: 1;
}

.contact-hero .hero-grid {
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
}

.contact-headline {
  font-family: var(--font-display-sb);
  font-size: clamp(48px, 11vw, 108px);      /* display */
  line-height: 1;
  color: var(--dk-text-strong);
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.contact-sub {
  font-size: 20px;                          /* body */
  color: var(--dk-text);
  max-width: 320px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display-sb);
  font-size: 20px;                          /* body */
  color: var(--dk-text-strong);
  padding: 16px 32px;
  border: 1px solid var(--dk-border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, color 0.3s;
}

.email-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--teal);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
  z-index: 0;
}

.email-link:hover::before { transform: translateY(0); }
.email-link:hover { border-color: transparent; color: var(--white); }
.email-link span { position: relative; z-index: 1; }

.email-link .arrow-icon {
  font-size: 0.8em;
  position: relative;
  z-index: 1;
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}
.email-link:hover .arrow-icon { transform: translate(3px, -3px); }

/* ============================================
   Project Detail
   ============================================ */
.project-detail .back-link {
  display: inline-block;
  margin-bottom: 40px;
  color: var(--lt-muted);
  font-size: 17px;                          /* meta */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.project-detail .back-link:hover { color: var(--teal); }

.project-detail h1 {
  margin-bottom: 16px;
}

.project-detail > p:first-of-type {
  font-size: 20px;                          /* body */
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: var(--text-measure);
}

.project-detail h2 {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--lt-border);
}

.project-detail p {
  margin-bottom: 24px;
  line-height: 1.8;
  max-width: var(--text-measure);
}

.project-detail ul {
  padding-left: 32px;
  margin: 16px 0 24px;
}

.project-detail li {
  font-size: 20px;                          /* body */
  line-height: 1.75;
  max-width: var(--text-measure);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .logo img { height: 80px; }


  /* Mobile nav overlay */
  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 24px;                        /* subhead */
    padding: 12px 24px;
    color: var(--dk-text);
  }
  .nav-links a::after { display: none; }
  .nav-links a:hover,
  .nav-links a.active { color: var(--teal); }
  .nav-toggle { z-index: 101; }

  /* Hero */
  .hero-inner {
    padding: 64px var(--gutter) 48px;
  }
  /* Sections */
  .section { padding-top: 48px; padding-bottom: 48px; }
  .page-header { margin-bottom: 32px; }

  /* Case list stacked on mobile */
  .case-item { flex-direction: column; gap: 8px; }
  .case-client { width: auto; }

  /* Grids */
  .specs-grid { flex-direction: column; }

  /* Team */
  .team-member {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0;
  }
  .team-member p { text-align: left; }

  /* Phase */
  .phase p { padding-left: 0; }

  /* Footer */
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .footer-nav {
    justify-content: center;
    gap: 12px;
  }

  /* Contact */
  .contact-headline { font-size: clamp(40px, 11vw, 72px); }
}

@media (min-width: 1200px) {
  :root { --container: 980px; }
}
