/*
Theme Name: Madesst Studio
Theme URI: https://madesst.com
Author: Mohamed Abdelhady
Author URI: https://madesst.com
Description: Custom theme for the MADESST.Studio rebrand — architecture practice site with dark, computational-design aesthetic.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: madesst-studio
*/

/* ==========================================================================
   MADESST.Studio rebrand — shared design tokens + component styles
   ========================================================================== */

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; }

.ms-scope {
  --bg: #0A0A0A;
  --elevated: #141414;
  --line: #2A2A28;
  --hi: #F4F2EE;
  --mid: #B9B7B1;
  --lo: #8A8A85;
  --radius: 0px;
  --text-display: clamp(32px, 6vw, 74px);
  --text-h2: clamp(20px, 2.4vw, 28px);
  --text-h3: 15px;
  --font-headline: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-wordmark: 'Archivo Expanded', sans-serif;
  --font-body: 'Inter', sans-serif;

  background: var(--bg);
  color: var(--mid);
  font-family: var(--font-body);
}
.ms-scope *, .ms-scope *::before, .ms-scope *::after { box-sizing: border-box; }
.ms-scope a { text-decoration: none; }

/* ---- Header / nav ---- */
.ms-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
}
.ms-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(14px);
}
.ms-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  height: 56px;
}
.ms-brand {
  justify-self: start;
  font-family: var(--font-wordmark);
  font-weight: 700;
  font-size: 15px;
  color: var(--hi);
}
.ms-brand span { color: var(--lo); font-weight: 500; }
.ms-nav { display: flex; justify-self: center; gap: 0; }
.ms-nav a {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lo);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.ms-nav a:hover { color: var(--hi); }
.ms-nav a.is-active { color: var(--hi); border-bottom-color: var(--hi); }
.ms-header__ext { display: flex; justify-self: end; border: 1px solid var(--line); }
.ms-header__ext a {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lo);
  padding: 8px 14px;
  border-left: 1px solid var(--line);
}
.ms-header__ext a:first-child { border-left: none; }
.ms-header__ext a:hover { color: var(--hi); }

.ms-burger {
  display: none;
  justify-self: end;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.ms-burger span, .ms-burger span::before, .ms-burger span::after {
  content: ''; display: block; width: 16px; height: 1px; background: var(--hi); position: relative;
}
.ms-burger span::before { position: absolute; top: -5px; }
.ms-burger span::after { position: absolute; top: 5px; }

/* ---- Buttons ---- */
.ms-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--hi);
  border-radius: var(--radius);
  cursor: pointer; transition: .16s; white-space: nowrap;
  background: var(--hi); color: var(--bg);
}
.ms-btn:hover { opacity: .85; }
.ms-btn--ghost { background: transparent; color: var(--hi); border-color: var(--lo); }

/* ---- Hero ---- */
.ms-hero {
  position: relative; min-height: 64vh; display: flex; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
}
.ms-hero__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .5; filter: grayscale(20%) contrast(1.05);
}
.ms-hero__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .4;
}
.ms-hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,.94) 0%, rgba(10,10,10,.7) 45%, rgba(10,10,10,.4) 100%);
}
.corner { position: absolute; width: 20px; height: 20px; z-index: 3; }
.corner::before, .corner::after { content: ""; position: absolute; background: var(--lo); }
.corner::before { width: 20px; height: 1px; top: 0; left: 0; }
.corner::after { width: 1px; height: 20px; top: 0; left: 0; }
.c-tl { top: 28px; left: 28px; }
.c-tr { top: 28px; right: 28px; transform: rotate(90deg); }
.c-bl { bottom: 28px; left: 28px; transform: rotate(-90deg); }
.c-br { bottom: 28px; right: 28px; transform: rotate(180deg); }
.ms-hero__geo {
  position: absolute; top: 28px; right: 56px; z-index: 3;
  font-family: var(--font-mono); font-size: 10px; color: var(--lo); letter-spacing: .05em;
}
.ms-hero__content {
  position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: center;
  padding: 64px 7vw; max-width: 820px;
}
.ms-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lo); margin-bottom: 22px; display: flex; align-items: center; gap: 12px;
}
.ms-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--lo); }
.ms-h1 {
  font-family: var(--font-headline); font-weight: 600; font-size: var(--text-display);
  letter-spacing: -0.025em; line-height: 1.02; color: var(--hi); margin: 0 0 24px;
}
.ms-h1 em { color: var(--mid); font-style: normal; }
.ms-hero__sub { font-size: 15px; color: var(--mid); line-height: 1.7; max-width: 440px; margin-bottom: 34px; }
.ms-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.ms-stats { display: flex; gap: 0; border-top: 1px solid var(--line); padding-top: 24px; flex-wrap: wrap; }
.ms-stat { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line); }
.ms-stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.ms-stat__num { font-family: var(--font-headline); font-weight: 600; font-size: 26px; line-height: 1; color: var(--hi); }
.ms-stat__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--lo); margin-top: 6px; }

/* ---- Marquee ---- */
.ms-marquee { overflow: hidden; white-space: nowrap; padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--elevated); }
.ms-marquee__track { display: inline-block; animation: ms-scroll 38s linear infinite; white-space: nowrap; }
.ms-marquee__item {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; padding: 0 20px; color: var(--mid);
}
.ms-marquee__dot { display: inline-block; width: 3px; height: 3px; background: var(--lo); vertical-align: middle; }
@keyframes ms-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---- Section shell ---- */
.ms-section { padding: 64px 40px; max-width: 1200px; margin: 0 auto; }
.ms-section--tight { padding-top: 0; }
.ms-section__head { margin-bottom: 32px; }
.ms-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--lo); margin-bottom: 8px; }
.ms-section__title-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.ms-h2 { font-family: var(--font-headline); font-weight: 600; font-size: var(--text-h2); letter-spacing: -0.01em; color: var(--hi); margin: 0; }
.ms-link-arrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--lo); }
.ms-link-arrow:hover { color: var(--hi); }

/* ---- Three scales grid ---- */
.ms-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ms-scale-card { background: var(--bg); padding: 36px 32px; }
.ms-scale-card__kicker { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lo); margin-bottom: 16px; }
.ms-scale-card__name { font-family: var(--font-wordmark); font-weight: 700; font-size: 16px; color: var(--hi); margin-bottom: 12px; }
.ms-scale-card__name span { color: var(--lo); font-weight: 500; }
.ms-scale-card__desc { font-size: 12.5px; color: var(--mid); line-height: 1.7; margin-bottom: 18px; }
.ms-scale-card__url { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--lo); }
a.ms-scale-card:hover .ms-scale-card__url,
a.ms-scale-card:hover .ms-scale-card__name { color: var(--hi); }

/* ---- Founder bio ---- */
.ms-bio { display: grid; grid-template-columns: 300px 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ms-bio__img { background-position: center top; background-size: cover; min-height: 340px; filter: grayscale(30%); }
.ms-bio__body { padding: 40px 44px; background: var(--bg); }
.ms-bio__name { font-family: var(--font-headline); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--hi); margin: 0 0 6px; }
.ms-bio__role { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--lo); margin-bottom: 20px; }
.ms-bio__text { font-size: 13px; color: var(--mid); line-height: 1.8; max-width: 600px; margin-bottom: 20px; }
.ms-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--lo); padding: 6px 12px; border: 1px solid var(--line); }

/* ---- Projects grid ---- */
.ms-projects { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ms-project { position: relative; overflow: hidden; display: block; background: var(--elevated); flex: 1 1 300px; }
.ms-project__img { width: 100%; height: 240px; object-fit: cover; filter: grayscale(25%); transform: scale(1); transition: transform .5s, filter .5s; display: block; }
.ms-project:hover .ms-project__img { transform: scale(1.04); filter: grayscale(0%); }
.ms-project__overlay {
  position: absolute; inset: 0; background: rgba(10,10,10,.72); opacity: 0; transition: opacity .22s;
  display: flex; align-items: center; justify-content: center;
}
.ms-project:hover .ms-project__overlay { opacity: 1; }
.ms-project__overlay span { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--hi); border: 1px solid var(--hi); padding: 9px 18px; }
.ms-project__body { padding: 18px 20px; border-top: 1px solid var(--line); }
.ms-project__meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--lo); margin-bottom: 6px; }
.ms-project__title { font-family: var(--font-headline); font-size: 15px; font-weight: 600; color: var(--hi); margin-bottom: 5px; }
.ms-project__desc { font-size: 11.5px; color: var(--mid); line-height: 1.55; }

/* ---- CTA ---- */
.ms-cta { padding: 56px 40px; text-align: center; border-top: 1px solid var(--line); background: var(--elevated); }
.ms-cta__title { font-family: var(--font-headline); font-size: clamp(22px, 3vw, 32px); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; color: var(--hi); }
.ms-cta__sub { font-size: 13px; color: var(--mid); max-width: 460px; margin: 0 auto 28px; line-height: 1.6; }

/* ---- Footer ---- */
.ms-footer { padding: 48px 28px 24px; border-top: 1px solid var(--line); max-width: 1200px; margin: 0 auto; background: var(--bg); }
.ms-footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--lo); }
.ms-footer__links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.ms-footer__links a, .ms-footer__links span { color: var(--lo); cursor: pointer; }
.ms-footer__links a:hover, .ms-footer__links span:hover { color: var(--hi); }

/* ---- Fade-up (scroll-in) ---- */
.ms-fu { opacity: 0; transform: translateY(16px); animation: ms-fu .6s ease forwards; }
@keyframes ms-fu { to { opacity: 1; transform: translateY(0); } }

/* ---- Default page content (existing Elementor-built pages) ---- */
.ms-page-content { background: var(--bg); min-height: 40vh; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .ms-header__inner { display: flex; align-items: center; justify-content: space-between; }
  .ms-nav { display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 99;
    justify-self: stretch; align-self: stretch;
    background: var(--bg); flex-direction: column; padding: 12px 28px; gap: 0; overflow-y: auto; }
  .ms-nav.is-open { display: flex; }
  .ms-nav a { height: 48px; border-bottom: 1px solid var(--line); justify-content: flex-start; }
  .ms-header__ext { display: none; }
  .ms-nav.is-open ~ .ms-header__ext,
  .ms-header.is-open .ms-header__ext { display: flex; position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 99; justify-content: center;
    justify-self: stretch; align-self: stretch; }
  .ms-burger { display: flex; }

  .ms-hero__content { padding: 48px 6vw; max-width: 100%; }
  .ms-hero__geo { display: none; }
  .ms-section { padding: 48px 24px; }
  .ms-grid-3, .ms-projects { grid-template-columns: 1fr; }
  .ms-bio { grid-template-columns: 1fr; }
  .ms-bio__img { min-height: 220px; }
}
@media (max-width: 480px) {
  .ms-stats { gap: 0; }
  .ms-stat { padding-right: 16px; margin-right: 16px; }
  .ms-hero__actions { flex-direction: column; align-items: stretch; }
}


/* ---- Timeline (About page) ---- */
.ms-timeline { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 24px; }
.ms-timeline__item { background: var(--bg); padding: 20px 24px; display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.ms-timeline__date { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lo); }
.ms-timeline__org { font-family: var(--font-headline); font-size: 14px; font-weight: 600; color: var(--hi); margin-bottom: 6px; }
.ms-timeline__detail { font-size: 12px; color: var(--mid); line-height: 1.65; margin: 0; padding-left: 16px; }
.ms-timeline__detail li { margin-bottom: 3px; }
@media (max-width: 700px) { .ms-timeline__item { grid-template-columns: 1fr; gap: 6px; } }

/* ---- Jobs page ---- */
.ms-jobs { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 24px; }
.ms-job { background: var(--bg); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ms-job__title { font-family: var(--font-headline); font-size: 16px; font-weight: 600; color: var(--hi); }
.ms-job__status { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--lo); }
.ms-job--closed .ms-job__title { color: var(--lo); }
.ms-job--closed .ms-job__status { color: #8B4A4A; }

/* ---- Service groups (Services / Design / Education pages) ---- */
.ms-service-group { margin-bottom: 44px; }
.ms-service-group__title { font-family: var(--font-headline); font-size: 18px; font-weight: 600; color: var(--hi); margin-bottom: 16px; }
.ms-service-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ms-service-item { background: var(--bg); padding: 20px 24px; }
.ms-service-item__name { font-family: var(--font-headline); font-size: 14px; font-weight: 600; color: var(--hi); margin-bottom: 6px; }
.ms-service-item__desc { font-size: 12.5px; color: var(--mid); line-height: 1.6; }

/* ---- Legal pages (Privacy / Terms) ---- */
.ms-legal { max-width: 820px; margin: 0 auto; padding: 96px 40px; }
.ms-legal h1 { font-family: var(--font-headline); font-size: var(--text-h2); font-weight: 600; color: var(--hi); margin-bottom: 8px; }
.ms-legal .ms-legal__updated { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lo); margin-bottom: 32px; }
.ms-legal h2 { font-family: var(--font-headline); font-size: 16px; font-weight: 600; color: var(--hi); margin: 32px 0 10px; }
.ms-legal p, .ms-legal li { font-size: 13px; color: var(--mid); line-height: 1.8; }
.ms-legal ul { padding-left: 20px; margin: 8px 0 20px; }

/* ---- Hero background crossfade + word rotation ---- */
.ms-hero__bg--a, .ms-hero__bg--b { transition: opacity 1.4s ease; }
.ms-hero__bg--b { opacity: 0; }
.ms-word-rotate { display: inline-block; transition: opacity .35s ease, transform .35s ease; }


/* ---- Project single body copy ---- */
.ms-prose { font-size: 14px; color: var(--mid); line-height: 1.8; }
.ms-prose p { margin: 0 0 20px; }
.ms-prose img { max-width: 100%; height: auto; margin: 20px 0; }
.ms-prose h2, .ms-prose h3 { font-family: var(--font-headline); color: var(--hi); margin: 32px 0 12px; }

/* ---- Project archive commission CTA card ---- */
.ms-project--cta { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 300px; }
.ms-project__cta-inner { padding: 32px; }

/* ---- Utility bar (2nd header row) ---- */
.ms-utility-bar { background: var(--bg); border-bottom: 1px solid var(--line); }
.ms-utility-bar__inner { max-width: 1200px; margin: 0 auto; padding: 8px 28px; text-align: center; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--lo); }

/* ---- Footer two-row layout ---- */
.ms-footer__row--top { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }