:root {
  --bg: #0f0f12;
  --bg-elev: #15161a;
  --text: #f2f2f2;
  --muted: #a4abb6;
  --line: rgba(242, 242, 242, 0.12);
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.2);
  --max-width: 1200px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

main {
  min-height: calc(100vh - 320px);
}

.container {
  width: min(calc(100% - 3rem), var(--max-width));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 9vw, 8rem) 0;
}

.section-tight {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section--projects {
  padding-top: clamp(16px, 2vw, 32px) !important;
}

.section-label {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-wrap {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  font-size: 0.87rem;
  font-weight: 750;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(242, 242, 242, 0.94);
}

.brand-mark {
  display: block;
  height: 35px;
  width: auto;
  flex: 0 0 auto;
  transform: translateY(2px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(242, 242, 242, 0.76);
  transition: color 160ms ease;
  position: relative;
  padding: 0.35rem 0;
  line-height: 1;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 160ms ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.hero {
  padding: clamp(5rem, 10vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
}

.hero--compact{
  min-height: auto !important;
  height: auto !important;
  padding-top: clamp(96px, 10vw, 140px);
  padding-bottom: clamp(28px, 5vw, 56px);
  display: block !important;
}

.hero--compact .container{
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.hero--compact .hero-title{
  margin-bottom: 16px;
}

.hero--compact .hero-sub{
  max-width: 720px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  max-width: 12ch;
}

.hero-sub {
  color: rgba(242, 242, 242, 0.7);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
  max-width: 60ch;
  margin-top: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 2.8vw, 3rem);
}

.stack {
  display: grid;
  gap: 1.25rem;
}

.card-min {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.card-min h3,
.card-min h4 {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  letter-spacing: 0.01em;
}

.card-min p,
p {
  color: rgba(242, 242, 242, 0.74);
  line-height: 1.8;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.5rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  transition: transform 200ms ease, background-color 200ms ease, border-color 200ms ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #0c0d10;
}

.btn-primary:hover {
  background: #3ec86e;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.split-feature {
  border-top: 1px solid var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}

.feature-row {
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}

.feature-row:first-child {
  border-top: 0;
}

.feature-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 5rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.93;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 2vw, 2.6rem);
}

.project-item {
  display: grid;
  gap: 1rem;
}

.project-visual {
  border: 1px solid transparent;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #0b0d12;
  transition: border-color 220ms ease, transform 220ms ease;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1);
  transition: transform 420ms ease;
}

.project-item:hover .project-visual {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-item:hover .project-visual img {
  transform: scale(1);
}

.project-item h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.project-item p {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.case-hero {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
}

.case-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  max-width: 16ch;
}

.case-showcase.showcase-grid {
  --shot-gap: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: var(--shot-gap);
  align-items: start;
}

.case-showcase .showcase-desktop-stack {
  display: grid;
  gap: var(--shot-gap);
}

.case-showcase .showcase-mobile {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.case-showcase .showcase-shot {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(242, 242, 242, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  background: #0b0d12;
  overflow: hidden;
  display: block;
}

.case-showcase .showcase-shot img {
  width: 100%;
  height: auto;
  display: block;
}

.case-showcase .showcase-shot.desktop img {
  object-fit: cover;
  object-position: top center;
}

.case-showcase .showcase-shot.mobile {
  width: min(100%, 240px);
  border-width: 1.5px;
}

.case-showcase .showcase-shot.mobile img {
  object-fit: contain;
  object-position: top center;
  padding: 10px 10px 0;
}

.case-showcase .shot-label {
  margin: 0;
  padding: 0.55rem 0.72rem 0.62rem;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 242, 242, 0.72);
  border-top: 1px solid rgba(242, 242, 242, 0.08);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #262930;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  padding: 0.9rem 1rem;
  border-radius: 4px;
}

input {
  min-height: 52px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(164, 171, 182, 0.7);
}

input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 2.4rem;
  margin-top: auto;
}

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

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a,
.footer-copy {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(242, 242, 242, 0.65);
}

.footer-links a:hover {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .grid-2,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 0.9rem;
  }

  .nav-link {
    font-size: 0.67rem;
    letter-spacing: 0.15em;
  }

  .hero-title {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 66px;
  }

  .container {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .brand {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  .brand-mark {
    height: 28px;
    transform: translateY(1px);
  }

  .header-wrap {
    gap: 12px;
  }

  .site-nav {
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .hero {
    padding-top: 4.4rem;
  }

  .hero-title {
    letter-spacing: 0.01em;
    line-height: 0.95;
  }

  .hero-sub {
    color: rgba(242, 242, 242, 0.83);
    max-width: 40ch;
  }

  .section {
    padding: 56px 0;
  }

  .section--after-hero-home {
    padding-top: clamp(32px, 5vw, 40px) !important;
  }

  .section-tight {
    padding: 48px 0;
  }

  .section-label {
    margin-bottom: 0.9rem;
  }

  .card-min {
    padding-top: 1.1rem;
  }

  .card-min h3 {
    font-size: 1.15rem;
  }

  .btn {
    width: 100%;
  }

  .btn--cta-home {
    min-height: 56px;
  }

}

@media (max-width: 520px) {
  /* Header: prevent crowding/overflow */
  .header-wrap {
    height: auto;
    padding: 0.75rem 0;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .brand {
    line-height: 1.1;
    letter-spacing: 0.14em;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
  }

  .nav-link {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    padding: 0.25rem 0;
  }

  /* Hero: tighter spacing + responsive headline */
  .hero {
    padding: 4.25rem 0 3.5rem;
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(2.2rem, 12.5vw, 3.6rem);
    line-height: 0.92;
  }

  .hero-sub {
    margin-top: 1.1rem;
    font-size: 1rem;
    line-height: 1.7;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  /* Sections: reduce vertical whitespace */
  .section {
    padding: 3.5rem 0;
  }

  .section-tight {
    padding: 3rem 0;
  }
}

/* === Projects page hero override === */
.hero.hero--compact{
  min-height: unset !important;
  height: auto !important;
  padding-top: clamp(96px, 10vw, 140px) !important;
  padding-bottom: clamp(20px, 3vw, 40px) !important;

  /* Kill full-screen centering behavior */
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
}

.hero.hero--compact .container{
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.hero.hero--compact .hero-title{
  margin-bottom: 16px !important;
}

.hero.hero--compact .hero-sub{
  max-width: 720px !important;
}

.section--projects{
  padding-top: clamp(16px, 2vw, 28px) !important;
}

.project-item p{
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 6px;
}

.project-item{
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-item:hover{
  transform: translateY(-2px);
}

.project-item:hover .project-visual img{
  transform: scale(1);
}

.project-visual img{
  transition: transform 220ms ease;
}

.project-visual{
  border: 1px solid rgba(74,222,128,0);
  transition: border-color 180ms ease;
}

.project-item:hover .project-visual{
  border-color: rgba(74,222,128,0.35);
}

/* === Case Study hero compact override === */
.case-hero.case-hero--compact{
  min-height: unset !important;
  height: auto !important;
  padding-top: clamp(96px, 10vw, 140px) !important;
  padding-bottom: clamp(28px, 5vw, 56px) !important;

  /* kill flex centering if present */
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
}

.case-hero.case-hero--compact .container{
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.case-hero.case-hero--compact h1{
  margin-bottom: 14px !important;
}

.case-hero.case-hero--compact .hero-sub{
  max-width: 760px !important;
}

.section--after-hero{
  padding-top: clamp(18px, 2.5vw, 36px) !important;
}

@media (max-width: 900px){
  .case-showcase {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .case-showcase.showcase-grid {
    grid-template-columns: 1fr;
  }

  .case-showcase .showcase-desktop-stack,
  .case-showcase .showcase-mobile {
    height: auto;
  }

  .case-showcase .showcase-desktop-stack {
    grid-template-rows: none;
    gap: 0.9rem;
  }

  .case-showcase .showcase-shot.mobile {
    width: min(100%, 320px);
  }
}

/* === Case study spacing: tighter + premium === */
.case-section{
  padding-top: clamp(32px, 4vw, 56px) !important;
  padding-bottom: clamp(32px, 4vw, 56px) !important;
  min-height: auto !important;
  height: auto !important;
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
}

body.no-reveal .reveal {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  visibility: visible !important;
  transition: none !important;
}

body.no-reveal .reveal * {
  transition: none !important;
}

/* Mobile hamburger navigation */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle-lines {
  display: block;
  width: 18px;
  height: 12px;
  margin: 0 auto;
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
}

.nav-toggle-lines::before {
  top: 0;
}

.nav-toggle-lines::after {
  bottom: 0;
}

.nav-mobile {
  display: none;
}

@media (max-width: 900px) {
  .site-nav {
    display: none !important;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-mobile {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 86vw);
    background: rgba(10, 12, 16, 0.98);
    transform: translateX(110%);
    transition: transform 200ms ease;
    z-index: 2000;
    padding: 92px 22px 22px;
  }

  body.nav-open .nav-mobile {
    transform: translateX(0);
  }

  body.nav-open .site-header {
    z-index: 3000;
  }

  body.nav-open::before {
    display: none !important;
    content: none !important;
  }

  .nav-mobile-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .nav-mobile-link {
    display: block;
    padding: 14px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .hero .btn-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .hero .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile hamburger stability */
html,
body {
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .nav-toggle-lines::before,
  .nav-toggle-lines::after {
    height: 2.5px;
  }

  .nav-mobile {
    z-index: 4000;
  }

  body.nav-open .site-header {
    z-index: 4100;
  }

  body:not(.nav-open) .nav-mobile {
    pointer-events: none;
  }

  .page-shell > main,
  .page-shell > [data-partial="footer"],
  .page-shell > #site-footer {
    transition: transform 280ms ease;
  }

  body.nav-open .page-shell > main,
  body.nav-open .page-shell > [data-partial="footer"],
  body.nav-open .page-shell > #site-footer {
    transform: translateY(240px);
  }

  body.nav-open::before {
    display: none !important;
    content: none !important;
  }
}
