/* ============ KLAT DIGITAL — CORE STYLES ============ */

:root {
  --bg: #0a0a0a;
  --bg-alt: #111111;
  --bg-card: #141414;
  --line: #262626;
  --text: #f5f5f5;
  --text-dim: #9a9a9a;
  --text-faint: #6b6b6b;
  --white: #ffffff;
  --accent: #ffffff;
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 2.5rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p { color: var(--text-dim); }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
  font-weight: 600;
}

.accent { color: var(--white); position: relative; }
.accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 0.1em;
  background: var(--white);
  opacity: 0.25;
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.btn-primary {
  background: var(--white);
  color: #0a0a0a;
}
.btn-primary:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--white);
}

.btn-block { width: 100%; }

/* ============ HEADER ============ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10,10,10,0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand-logo { height: 46px; width: auto; }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  font-size: 0.9rem;
}
.nav-desktop a {
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-desktop a:hover { color: var(--white); }

.nav-cta {
  color: var(--white) !important;
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: var(--radius);
}
.nav-cta:hover { border-color: var(--white); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--white);
  transition: all 0.25s ease;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0 32px 24px;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.nav-mobile a { color: var(--text-dim); font-size: 1rem; }
.nav-mobile.open { display: flex; }

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 76px;
  overflow: hidden;
}

/* ============ HERO BACKGROUND — AMBIENT LIVE-CODE "VIDEO" ============ */

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #060606;
  display: flex;
  gap: 4rem;
  padding: 0 4vw;
}

.code-stream {
  flex: 1;
  height: 100%;
  overflow: hidden;
  padding-top: 6vh;
  letter-spacing: normal;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 2.1;
  opacity: 0.38;
  filter: blur(0.6px);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(6,6,6,0.58) 0%, rgba(6,6,6,0.88) 62%, rgba(6,6,6,0.97) 100%);
}

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

.hero-logo {
  height: clamp(150px, 21vw, 265px);
  width: auto;
  margin: 0 auto 2.5rem;
}


.hero-tagline {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.hero-tagline .accent { color: var(--white); }

.hero-sub {
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 2.5rem;
  color: var(--text-faint);
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.code-line { white-space: pre; break-inside: avoid; }
.tok-kw   { color: #ff7ab8; }
.tok-var  { color: #f5f5f5; }
.tok-prop { color: #7ec9ff; }
.tok-str  { color: #a3e08a; }
.tok-fn   { color: #ffd479; }
.tok-punc { color: #6b6b6b; }
.tok-com  { color: #565656; }

.caret {
  display: inline-block;
  width: 6px;
  height: 13px;
  background: #f5f5f5;
  margin-left: 1px;
  vertical-align: -2px;
  animation: caret-blink 0.9s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* ============ MARQUEE ============ */

.marquee-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  overflow: hidden;
  background: var(--bg-alt);
}
.marquee { width: 100%; overflow: hidden; }
.marquee-track {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: scroll-left 28s linear infinite;
  width: max-content;
}
.marquee-track span {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #8a8a8a;
  font-weight: 600;
}
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ SECTIONS GENERAL ============ */

section:not(.hero):not(.marquee-section) {
  padding: 130px 0;
}

.services { background: var(--bg); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.service-card {
  position: relative;
  background: var(--bg);
  padding: 3rem 2.25rem;
  overflow: hidden;
  transition: background 0.3s ease;
}
.service-card:hover { background: var(--bg-card); }
.service-card:hover .service-icon { transform: translateY(-3px); color: var(--white); }

.service-num {
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  font-size: 5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.045);
  letter-spacing: -0.03em;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.service-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  transition: transform 0.25s var(--ease), color 0.25s ease;
}

.service-card h3,
.service-card p {
  position: relative;
  z-index: 1;
}

.service-card p { margin-bottom: 0; font-size: 0.95rem; }

.hero-badges-wrap {
  position: relative;
  z-index: 3;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.75rem 32px;
}

.service-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.service-badges li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  position: relative;
}

.service-badges li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-faint);
}

.service-badges li:not(:last-child)::after {
  content: "•";
  position: absolute;
  right: -1.4rem;
  color: var(--text-faint);
}

/* ============ PROCESS ============ */

.process { background: var(--bg-alt); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
}

.process-step {
  position: relative;
}

.process-step:nth-child(odd)::after {
  content: "→";
  position: absolute;
  top: 17px;
  right: 0;
  transform: translate(50%, -50%);
  color: var(--text-faint);
  font-size: 1.1rem;
  z-index: 2;
}

.step-num {
  position: relative;
  z-index: 3;
  display: inline-block;
  font-size: 0.85rem;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-bottom: 1.25rem;
  color: var(--text-dim);
  background: var(--bg-alt);
}

.process-step p { font-size: 0.9rem; }

.process-tagline {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* ============ WORK ============ */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
  max-width: 920px;
}

.work-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s ease;
}
.work-card:hover {
  transform: translateY(-6px);
  border-color: #3a3a3a;
}

.work-media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-card);
}

.work-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.18);
  transition: background 0.3s ease;
  pointer-events: none;
}
.work-card:hover .work-media::before {
  background: rgba(0,0,0,0.32);
}

.work-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s var(--ease);
}
.work-card:hover .work-image { transform: scale(1.05); }

.work-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(to top, rgba(6,6,6,0.95) 0%, rgba(6,6,6,0.68) 38%, rgba(6,6,6,0.05) 72%, transparent 100%);
}

.work-overlay h3 {
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.work-overlay p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
  max-width: 90%;
}

.work-visit-pill {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  padding: 10px 22px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.work-card:hover .work-visit-pill,
.work-visit-pill:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.08);
}

.work-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

/* ============ ABOUT ============ */

.about { background: var(--bg-alt); }
.about-text { max-width: 760px; }
.about-text p { font-size: 1.05rem; margin-bottom: 2.5rem; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}
.stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ============ CONTACT ============ */

.contact-inner { max-width: 720px; }
.contact-sub { margin-bottom: 3rem; font-size: 1.05rem; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

input, select, textarea {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--white);
}
textarea { resize: vertical; }

.form-status {
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}
.form-status.success { color: #b7f5c2; }

/* ============ FOOTER ============ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { height: 25px; opacity: 0.8; }
.footer-copy { font-size: 0.8rem; color: var(--text-faint); }

/* ============ REVEAL ANIMATION ============ */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; gap: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .code-stream { font-size: 0.85rem; }
  .code-stream:nth-child(4) { display: none; }
  .service-card { padding: 2.25rem 1.75rem; }
}

@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
  section:not(.hero):not(.marquee-section) { padding: 90px 0; }
  .container { padding: 0 22px; }
  .hero-cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  .code-stream { font-size: 0.75rem; opacity: 0.35; }
  .code-stream:nth-child(3) { display: none; }
  .process-grid { gap: 1.75rem 1rem; }
  .process-step:nth-child(odd)::after { font-size: 0.85rem; top: 14px; }
  .step-num { width: 28px; height: 28px; line-height: 28px; font-size: 0.75rem; }
  .process-step p { font-size: 0.78rem; }
  .process-tagline { font-size: 0.82rem; }
  .service-grid { gap: 1px; }
  .service-card { padding: 1.5rem 1.1rem; }
  .service-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
  .service-card p { font-size: 0.78rem; margin-bottom: 0; }
  .service-num { font-size: 3rem; top: 0.25rem; right: 1rem; }
  .service-icon { width: 24px; height: 24px; margin-bottom: 1rem; }
  .work-media { aspect-ratio: 4 / 3; }
  .work-overlay { padding: 1.25rem 1.1rem; }
  .work-overlay h3 { font-size: 1rem; }
  .work-overlay p { font-size: 0.78rem; margin-bottom: 0.75rem; }
  .modal-panel { grid-template-columns: 1fr; max-height: 92vh; }
  .modal-media { max-height: 260px; }
  .modal-body { padding: 1.75rem 1.5rem 2rem; }
}

/* ============ CASE STUDY MODAL ============ */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4,4,4,0.82);
  backdrop-filter: blur(6px);
  padding: 4vh 20px;
  overflow-y: auto;
}
.modal-backdrop.open { display: block; }

.modal-panel {
  position: relative;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-in 0.3s var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--white);
  background: rgba(6,6,6,0.6);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.modal-close:hover { border-color: var(--white); background: rgba(6,6,6,0.85); }

.modal-media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-card);
}
.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 2rem 2.25rem 2.25rem;
  overflow-y: auto;
}

.modal-body h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-summary {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.modal-body h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.modal-body > p {
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.modal-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.modal-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--line);
  transition: transform 0.25s var(--ease), border-color 0.2s ease;
}
.modal-gallery img:hover {
  transform: translateY(-3px);
  border-color: #3a3a3a;
}
