/* NOTE: Replace 'Outfit' with 'Line Regular' once the .woff2 files from the
   graphic designer are integrated. Outfit is a close geometric substitute. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ════════════════════════════════
   BRAND PALETTE
   Primary:   #39a6a6  (teal)
   Secondary: #7a2342  (burgundy)
   Navy:      #142f43  (hero / dark sections — fixed)
════════════════════════════════ */

/* LIGHT MODE */
:root {
  --p:          #39a6a6;
  --p-light:    #5bbebe;
  --p-pale:     #e8f6f6;
  --p-rgb:      57,166,166;
  --cta:        #7a2342;
  --cta-light:  #9b3457;
  --cta-pale:   #f5e6eb;
  --navy:       #142f43;
  --bg:         #fafaf9;
  --bg-alt:     #f2f1ef;
  --surface:    #ffffff;
  --surface-b:  rgba(12,45,69,0.07);
  --text:       #142f43;
  --muted:      #5a7a8e;
}

/* DARK MODE */
[data-theme="dark"] {
  --p:          #39a6a6;
  --p-light:    #5bbebe;
  --p-pale:     rgba(57,166,166,0.12);
  --p-rgb:      57,166,166;
  --cta:        #9b3457;
  --cta-light:  #b84d70;
  --cta-pale:   rgba(155,52,87,0.15);
  --navy:       #142f43;
  --bg:         #0d1e2e;
  --bg-alt:     #091623;
  --surface:    rgba(255,255,255,0.045);
  --surface-b:  rgba(57,166,166,0.14);
  --text:       #e0eaf2;
  --muted:      #7a9ab0;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--p); border-radius: 3px; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 clamp(1.5rem, 5vw, 5rem);
  transition: background 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  background: rgba(20,47,67,0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(57,166,166,0.18);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
/* Logo — inline SVG symbol, recolored via currentColor / var(--p) */
.logo { display: block; }
.nav-logo .logo { width: 51px; height: 40px; color: var(--p); }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.72); text-decoration: none; font-size: 0.9rem;
  font-weight: 500; letter-spacing: 0.03em; transition: color 0.2s;
}
.nav-links a:hover { color: var(--p); }
.nav-cta {
  background: var(--cta); color: white; padding: 0.5rem 1.3rem;
  border-radius: 6px; font-weight: 600; font-size: 0.88rem;
  text-decoration: none; transition: background 0.2s, transform 0.15s;
}
.nav-cta:hover { background: var(--cta-light); transform: translateY(-1px); color: white; }

/* ── HERO (always dark navy) ── */
.hero {
  background: var(--navy); min-height: 100vh;
  display: flex; align-items: center;
  padding: 0 clamp(1.5rem, 5vw, 5rem);
  position: relative; overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(57,166,166,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57,166,166,0.055) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-glow { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(90px); }
.hero-glow-1 { width: 480px; height: 480px; background: var(--p); opacity: 0.1; top: -80px; right: 8%; }
.hero-glow-2 { width: 280px; height: 280px; background: var(--cta); opacity: 0.12; bottom: 5%; left: -40px; }
.hero-inner {
  max-width: 1240px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
  padding-top: 5rem;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(57,166,166,0.12); border: 1px solid rgba(57,166,166,0.28);
  padding: 0.35rem 1rem; border-radius: 100px; margin-bottom: 1.5rem;
  color: var(--p); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--p); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(1.4)} }
.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4.2rem); font-weight: 800;
  color: white; line-height: 1.08; letter-spacing: -0.02em; text-wrap: pretty;
}
.hero h1 .ac { color: var(--p); }
.hero-sub {
  margin-top: 1.5rem; font-size: 1.05rem;
  color: rgba(255,255,255,0.58); line-height: 1.72; max-width: 480px;
}
.hero-actions { margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-cta {
  background: var(--cta); color: white; padding: 0.85rem 2rem;
  border-radius: 8px; font-weight: 700; font-size: 1rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-cta:hover { background: var(--cta-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(122,35,66,0.4); }
.btn-ghost {
  background: transparent; color: white; padding: 0.85rem 2rem;
  border-radius: 8px; font-weight: 600; font-size: 1rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid rgba(255,255,255,0.22); transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--p); color: var(--p); transform: translateY(-2px); }
.hero-stats { margin-top: 3rem; display: flex; gap: 2.5rem; }
.stat-num { font-size: 2rem; font-weight: 800; color: white; }
.stat-num span { color: var(--p); }
.stat-lbl { font-size: 0.8rem; color: rgba(255,255,255,0.42); margin-top: 2px; }

/* ── HERO VISUAL ── */
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.hero-visual .logo {
  width: clamp(230px, 28vw, 340px);
  aspect-ratio: 1970 / 1535;
  color: var(--p);
  filter: drop-shadow(0 20px 50px rgba(57,166,166,0.22));
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.code-card {
  background: rgba(8,20,32,0.92); border: 1px solid rgba(57,166,166,0.22);
  border-radius: 12px; padding: 1rem 1.3rem;
  font-family: 'Courier New', monospace; font-size: 0.76rem;
  color: rgba(255,255,255,0.65); line-height: 1.8;
  width: 100%; max-width: 300px;
}
.ct { color: var(--p); }
.cb { color: var(--cta); opacity: 0.85; }
.cw { color: rgba(255,255,255,0.9); }
.cd { color: rgba(255,255,255,0.3); }

/* ── SHARED SECTION ── */
.section { padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 5vw, 5rem); transition: background 0.35s; }
.section-inner { max-width: 1240px; margin: 0 auto; }
.lbl {
  display: inline-block; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--p); margin-bottom: 0.75rem;
}
.ttl {
  font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 800;
  color: var(--text); line-height: 1.14; letter-spacing: -0.02em;
}
.ttl .ac { color: var(--p); }
.ttl-dark { color: white; }
.sub { margin-top: 1rem; font-size: 1.02rem; color: var(--muted); line-height: 1.72; max-width: 560px; }
.sub-dark { color: rgba(255,255,255,0.48); }

/* ── SERVICES ── */
.services { background: var(--bg); }
.svc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; margin-top: 3.5rem;
}
.svc-card {
  background: var(--surface); border: 1px solid var(--surface-b);
  border-radius: 16px; padding: 2rem; position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, background 0.35s, border-color 0.35s;
}
.svc-card::before {
  content:''; position: absolute; top:0; left:0; right:0; height: 3px;
  background: var(--p); transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.svc-card:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(0,0,0,0.14); }
.svc-card:hover::before { transform: scaleX(1); }
.svc-icon {
  width: 50px; height: 50px; border-radius: 12px;
  background: var(--p-pale); display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; margin-bottom: 1.2rem;
  transition: background 0.35s;
}
.svc-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.45rem; transition: color 0.35s; }
.svc-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.65; transition: color 0.35s; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.2rem; }
.tag {
  background: var(--p-pale); color: var(--p);
  font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 100px;
  transition: background 0.35s;
}

/* ── REFERENCES (always dark navy) ── */
.refs { background: var(--navy); }
.refs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem; margin-top: 3.5rem;
}
.ref-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(57,166,166,0.14);
  border-radius: 16px; padding: 2rem; transition: all 0.3s;
}
.ref-card:hover { background: rgba(57,166,166,0.07); border-color: rgba(57,166,166,0.32); transform: translateY(-4px); }
.ref-hd { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.ref-icon {
  width: 46px; height: 46px; border-radius: 10px;
  background: rgba(57,166,166,0.14); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.ref-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--p); background: rgba(57,166,166,0.12); padding: 3px 10px; border-radius: 100px;
}
.ref-card h3 { font-size: 1.1rem; font-weight: 700; color: white; margin-bottom: 0.4rem; }
.ref-card p { font-size: 0.87rem; color: rgba(255,255,255,0.48); line-height: 1.65; }
.ref-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.2rem; }
.stack-tag {
  font-size: 0.68rem; font-weight: 500; padding: 2px 8px; border-radius: 4px;
  background: rgba(57,166,166,0.09); color: rgba(57,166,166,0.85);
  border: 1px solid rgba(57,166,166,0.2); font-family: 'Courier New', monospace;
}

/* ── PROCESS ── */
.process { background: var(--bg-alt); transition: background 0.35s; }
.process-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  margin-top: 3.5rem;
}
.p-step { padding: 2rem 1.5rem; position: relative; display: flex; flex-direction: column; gap: 1rem; }
.p-step:not(:last-child)::after {
  content:'→'; position: absolute; right: -8px; top: 2.2rem;
  font-size: 1.4rem; color: var(--p); opacity: 0.35;
}
.p-num { font-size: 2.8rem; font-weight: 800; color: var(--p); opacity: 0.22; line-height: 1; }
.p-title { font-size: 1rem; font-weight: 700; color: var(--text); transition: color 0.35s; }
.p-desc { font-size: 0.87rem; color: var(--muted); line-height: 1.65; transition: color 0.35s; }

/* ── ABOUT ── */
.about { background: var(--bg); transition: background 0.35s; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.values { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.val {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.2rem;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--surface-b);
  transition: background 0.35s, border-color 0.35s;
}
.val-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--p-pale); display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: background 0.35s;
}
.val h4 { font-size: 0.93rem; font-weight: 700; color: var(--text); margin-bottom: 3px; transition: color 0.35s; }
.val p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; transition: color 0.35s; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-box { background: var(--navy); border-radius: 16px; padding: 1.75rem; display: flex; flex-direction: column; gap: 4px; }
.stat-box:first-child { grid-column: 1/-1; background: var(--p); }
.stat-box .n { font-size: 2.4rem; font-weight: 800; color: white; }
.stat-box .l { font-size: 0.8rem; color: rgba(255,255,255,0.58); }

/* ── CONTACT (always dark navy) ── */
.contact { background: var(--navy); overflow: hidden; position: relative; }
.contact::before {
  content: '</>'; position: absolute; right: -2rem; top: 50%; transform: translateY(-50%);
  font-size: clamp(8rem, 18vw, 16rem); font-weight: 800;
  color: rgba(57,166,166,0.035); font-family: monospace; pointer-events: none; white-space: nowrap;
}
.contact-form { margin-top: 2.5rem; max-width: 600px; display: flex; flex-direction: column; gap: 1.2rem; position: relative; z-index: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fg { display: flex; flex-direction: column; gap: 0.38rem; }
.fg label { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; }
.fg input, .fg textarea, .fg select {
  background: rgba(255,255,255,0.055); border: 1px solid rgba(57,166,166,0.22);
  color: white; border-radius: 8px; padding: 0.78rem 1rem; font-size: 0.93rem;
  font-family: 'Outfit', sans-serif; outline: none; transition: border-color 0.2s, background 0.2s;
}
.fg input::placeholder, .fg textarea::placeholder { color: rgba(255,255,255,0.22); }
.fg input:focus, .fg textarea:focus, .fg select:focus { border-color: var(--p); background: rgba(57,166,166,0.07); }
.fg select { color: rgba(255,255,255,0.65); }
.fg select option { background: #142f43; color: white; }
.fg textarea { resize: vertical; min-height: 110px; }
.form-ok {
  display: none; padding: 0.9rem 1.3rem; border-radius: 8px;
  background: rgba(57,166,166,0.12); border: 1px solid rgba(57,166,166,0.35);
  color: var(--p); font-weight: 600; font-size: 0.93rem;
}
.form-ok.show { display: block; }

/* ── FOOTER ── */
.footer {
  background: #070f18; padding: 2.5rem clamp(1.5rem, 5vw, 5rem);
  border-top: 1px solid rgba(57,166,166,0.08);
}
.footer-in {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-in .logo { width: 38px; height: 30px; color: var(--p); opacity: 0.65; transition: opacity 0.2s; }
.footer-in a:hover .logo { opacity: 1; }
.footer-links { display: flex; gap: 1.75rem; }
.footer-links a { color: rgba(255,255,255,0.32); font-size: 0.8rem; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--p); }
.footer-copy { color: rgba(255,255,255,0.2); font-size: 0.76rem; }

/* ── SETTINGS FAB ── */
#tweaksFab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 998;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--cta); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  transition: background 0.2s, transform 0.3s;
}
#tweaksFab:hover { background: var(--cta-light); }
#tweaksFab.spinning { animation: spin 0.4s ease; }
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(180deg)} }
#tweaksFab svg { width: 20px; height: 20px; fill: white; display: block; }

/* ── SETTINGS OVERLAY ── */
#tweaksOverlay {
  display: none; position: fixed; inset: 0; z-index: 997;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(5px);
  justify-content: flex-end; align-items: flex-end;
  padding: 5rem 1.5rem 5rem;
}
#tweaksOverlay.open { display: flex; }
.tw-modal {
  background: rgba(10,26,40,0.98); border: 1px solid rgba(57,166,166,0.28);
  border-radius: 20px; padding: 1.6rem; width: 272px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
  animation: twIn 0.22s ease;
}
@keyframes twIn { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
.tw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.tw-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--p); }
.tw-close {
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.5);
  cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.tw-close:hover { background: rgba(255,255,255,0.14); color: white; }
.tw-grp { margin-bottom: 1.3rem; }
.tw-grp-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.22); margin-bottom: 0.8rem; }
.tw-row { margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 6px; }
.tw-lbl { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.tw-row input[type=color] {
  width: 100%; height: 36px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; cursor: pointer; background: rgba(255,255,255,0.04); padding: 3px;
}
.tw-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tw-row input[type=color]::-webkit-color-swatch { border: none; border-radius: 5px; }
.tw-reset {
  margin-top: 0.3rem; width: 100%; padding: 0.45rem;
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55); border-radius: 7px;
  font-size: 0.75rem; font-family: 'Outfit', sans-serif; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tw-reset:hover { background: rgba(255,255,255,0.05); color: white; border-color: rgba(255,255,255,0.2); }
.tw-seg { display: flex; gap: 4px; }
.tw-seg button {
  flex: 1; padding: 0.38rem; border-radius: 7px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.45);
  font-size: 0.76rem; font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.15s;
}
.tw-seg button.on { background: var(--p); border-color: transparent; color: white; font-weight: 600; }

/* Reveal-on-scroll prep */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { order: -1; }
  .hero-visual .logo { width: 180px; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .stat-grid { order: -1; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .p-step:not(:last-child)::after { display: none; }
}
