/* ===========================================================
   Reyco - engineered precision
   =========================================================== */

:root {
  --bg:        #08090a;
  --surface:   #0e1012;
  --surface-2: #14171a;
  --line:      #20242a;
  --text:      #ecedef;
  --muted:     #8b919b;
  --faint:     #5a616b;
  --accent:    #c6f24e;
  --accent-dim:#9bbf3a;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body:    "Hanken Grotesk", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1120px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

::selection { background: var(--accent); color: #0a0a0a; }

a { color: inherit; text-decoration: none; }

/* ---------- Atmosphere layers ---------- */
.grid-bg {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
}
.glow {
  position: fixed; top: -25vh; left: 50%; transform: translateX(-50%);
  width: 90vw; height: 70vh; z-index: -2;
  background: radial-gradient(circle at 50% 50%, rgba(198,242,78,0.10), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,9,10,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.01em; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.nav-links a { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: var(--text) !important; border: 1px solid var(--line);
  padding: 0.45rem 0.9rem; border-radius: 999px; transition: all 0.25s var(--ease);
}
.nav-cta:hover { border-color: var(--accent); background: rgba(198,242,78,0.08); }

/* ---------- Layout helpers ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { padding-block: clamp(5rem, 12vh, 9rem); }

.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 3rem; }
.section-num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-dim); }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; }

.kicker {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em;
  color: var(--muted); text-transform: none; margin-bottom: 1.5rem;
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(8rem, 22vh, 12rem); padding-bottom: clamp(4rem, 9vh, 7rem); }
.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 6.2rem); line-height: 0.98;
  letter-spacing: -0.035em; margin-bottom: 1.8rem;
}
.hero-title .line { display: block; }
.accent { color: var(--accent); }

/* Cycling last word */
.rotator { display: inline-block; will-change: transform, opacity; }
.rotator::after { content: "."; }
.hero-sub { max-width: 46ch; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.22rem); margin-bottom: 2.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 3.5rem; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 1.2rem 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.meta-item { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.meta-k { color: var(--faint); margin-right: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.88rem; font-weight: 500;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--accent); color: #0a0c06; box-shadow: 0 0 0 rgba(198,242,78,0); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(198,242,78,0.45); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); transform: translateY(-2px); }

/* ---------- Services ---------- */
.svc-list { list-style: none; border-top: 1px solid var(--line); }
.svc {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 4vw, 3rem);
  align-items: start; padding: 2.2rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s var(--ease);
}
.svc:hover { padding-left: 0.75rem; }
.svc-num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-dim); padding-top: 0.5rem; }
.svc-body h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3.5vw, 2rem); letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.svc-body p { color: var(--muted); max-width: 54ch; }

/* ---------- Automation proof gallery ---------- */
.svc-proof { margin-top: clamp(2.5rem, 6vw, 4rem); }
.proof-lead {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-dim);
  margin-bottom: 1.4rem;
}
.proof-item { margin: 0; }
.proof-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
@media (max-width: 760px) { .proof-grid-2 { grid-template-columns: 1fr; } }
.proof-shot {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 24px 60px -28px rgba(0,0,0,0.7);
  position: relative;
}
.proof-shot img { display: block; width: 100%; height: auto; }
.proof-shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 40px 0 rgba(8,9,10,0.25);
}
.proof-cap {
  margin-top: 0.9rem; font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--muted); max-width: 72ch; line-height: 1.6;
}

/* ---------- Work / Cases ---------- */
.cases { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.case {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem); overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.case:hover { border-color: #2c333b; transform: translateY(-3px); }
.case:nth-child(even) .case-info { order: -1; }
.case-media {
  position: relative; aspect-ratio: 16/10; border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(198,242,78,0.10), transparent 55%),
    var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.case-media img { width: 100%; height: 100%; object-fit: cover; }
.case-media[data-label]::after {
  content: attr(data-label);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.15em;
  color: var(--faint); border: 1px dashed var(--line); padding: 0.4rem 0.7rem; border-radius: 6px;
}
.case-media img + ::after { display: none; }
.case-tag { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent-dim); }
.case-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.02em; margin: 0.6rem 0 0.8rem; }
.case-desc { color: var(--muted); margin-bottom: 1.2rem; }
.case-link { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.case-link:hover { border-color: var(--accent); }
.case-stack { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.case-stack li { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); padding: 0.3rem 0.6rem; border-radius: 999px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-portrait {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.7);
}
.about-portrait img { display: block; width: 100%; height: auto; }
.about-portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(198,242,78,0.10);
  background: linear-gradient(180deg, transparent 60%, rgba(8,9,10,0.35));
}
.about-body { display: grid; gap: 1.5rem; max-width: 60ch; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 260px; }
}
.about-lead { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.4rem, 3.5vw, 2rem); line-height: 1.3; letter-spacing: -0.02em; }
.about-detail { color: var(--muted); font-size: 1.08rem; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { max-width: 38ch; margin: 0 auto; }
.contact .kicker { text-align: center; }
.contact-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 1.2rem; }
.contact-sub { color: var(--muted); margin-bottom: 2.4rem; }
.contact-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 2.5rem var(--pad); border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--faint);
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal[data-d="0"].in { transition-delay: 0.05s; }
.reveal[data-d="1"].in { transition-delay: 0.15s; }
.reveal[data-d="2"].in { transition-delay: 0.25s; }
.reveal[data-d="3"].in { transition-delay: 0.40s; }
.reveal[data-d="4"].in { transition-delay: 0.52s; }
.reveal[data-d="5"].in { transition-delay: 0.64s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   Case study page
   =========================================================== */
.cs-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted);
  margin-top: clamp(6rem, 14vh, 8rem); margin-bottom: 2rem; transition: color 0.2s;
}
.cs-back:hover { color: var(--accent); }

.cs-hero { padding-top: 0; padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.cs-tag { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-dim); }
.cs-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1.0; letter-spacing: -0.035em;
  margin: 1rem 0 1.2rem;
}
.cs-lead { max-width: 56ch; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.cs-lead a, .cs-p a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); transition: border-color 0.2s; }
.cs-lead a:hover, .cs-p a:hover { border-color: var(--accent); }
.cs-facts {
  display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem;
  margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.cs-fact { font-family: var(--font-mono); font-size: 0.8rem; }
.cs-fact .k { display: block; color: var(--faint); margin-bottom: 0.3rem; }
.cs-fact .v { color: var(--text); }

/* Section blocks */
.cs-block { padding-block: clamp(2.5rem, 6vh, 4rem); }
.cs-h { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.cs-p { color: var(--muted); max-width: 64ch; margin-bottom: 1rem; font-size: 1.06rem; }
.cs-p strong { color: var(--text); font-weight: 600; }

/* Feature grid */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.feat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem; transition: border-color 0.3s, transform 0.3s var(--ease);
}
.feat:hover { border-color: #2c333b; transform: translateY(-3px); }
.feat .feat-n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-dim); }
.feat h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; margin: 0.5rem 0 0.5rem; }
.feat p { color: var(--muted); font-size: 0.95rem; }

/* Screenshot frame */
.shots { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); margin-top: 1.5rem; }
.shot {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface);
}
.shot-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.shot-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot-bar .dot:nth-child(1) { background: #ff5f57; opacity: 0.6; }
.shot-bar .dot:nth-child(2) { background: #febc2e; opacity: 0.6; }
.shot-bar .dot:nth-child(3) { background: #28c840; opacity: 0.6; }
.shot-bar .url { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); margin-left: 0.6rem; }
.shot-img img { display: block; width: 100%; height: auto; }
.shot-ph {
  aspect-ratio: 16/9; display: grid; place-content: center; justify-items: center; gap: 0.5rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(198,242,78,0.08), transparent 55%),
    var(--surface-2);
  text-align: center; padding: 1.5rem;
}
.shot-ph .lbl { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; }
.shot-ph .sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--faint); border: 1px dashed var(--line); padding: 0.35rem 0.7rem; border-radius: 6px; }
.shot-cap { padding: 0.9rem 1rem; font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--line); }

/* Gallery layout variants */
.shot.center { max-width: 400px; margin-inline: auto; }
.shots.apps { grid-template-columns: repeat(3, 1fr); align-items: start; }
.shots.apps .shot-img { position: relative; height: 460px; overflow: hidden; }
.shots.apps .shot-img img { height: 100%; object-fit: cover; object-position: top; }
.shots.apps .shot-img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.shots.tiles { grid-template-columns: repeat(3, 1fr); }
.shots.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .shots.two { grid-template-columns: 1fr; } }
.shot.peek .shot-img { position: relative; height: 560px; overflow: hidden; }
.shot.peek .shot-img img { height: 100%; object-fit: cover; object-position: top; }
.shot.peek .shot-img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.cs-banner { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin-top: 1rem; }
.cs-banner img { display: block; width: 100%; height: clamp(220px, 40vh, 400px); object-fit: cover; }
@media (max-width: 860px) {
  .shots.apps, .shots.tiles { grid-template-columns: 1fr; }
  .shots.apps .shot-img { height: auto; }
  .shots.apps .shot-img img { height: auto; }
  .shots.apps .shot-img::after { display: none; }
}

/* Responsive ---------- */
@media (max-width: 720px) {
  .nav-links { gap: 0.9rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .case { grid-template-columns: 1fr; }
  .case:nth-child(even) .case-info { order: 0; }
  .footer { justify-content: center; text-align: center; }
}

