/* Ekistics Property Advisors LLP — site styles
   Self-contained: fonts in ../assets/fonts, images in ../assets/images.
   Fixes vs the original single-file design:
     - fixed-nav no longer overlaps content when zoomed / low-res (--nav-h offset + dvh)
     - portfolio "Realised" divider height is robust across breakpoints
     - extra small-screen (<=480px) tuning for mobile
*/

:root {
  --black: #0a0a0a;
  --white: #f5f2ed;
  --cream: #ede9e2;
  --mid: #c8c4be;
  --border: rgba(245,242,237,0.12);
  --border-dark: rgba(10,10,10,0.12);
  --nav-h: 72px;               /* single source of truth for nav height */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);   /* anchor jumps land below the fixed nav */
}

body {
  background: var(--black);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;                 /* never allow sideways scroll on mobile */
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: var(--nav-h);
  background: var(--black);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--white);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--white); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  min-height: 100dvh;                       /* correct height on mobile browsers */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* top padding clears the fixed nav so content never hides behind it when
     the viewport is short (zoomed in / small screens) */
  padding: calc(var(--nav-h) + 32px) 48px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 28px;
}

.hero-logo {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(51px, 8vw, 128px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 48px;
}

.hero-headline {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(42px, 5.6vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--white);
  max-width: 900px;
  margin-bottom: 48px;
}

.hero-headline em { font-style: italic; color: var(--cream); }

.hero-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 40px;
  max-width: 680px;
  justify-content: center;
}

.stat {
  flex: 1;
  padding-right: 40px;
  border-right: 1px solid var(--border);
  margin-right: 40px;
}

.stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 48px;
  line-height: 1;
  color: var(--white);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  line-height: 1.5;
}

/* ── SECTIONS ── */
section {
  padding: 100px 48px;
  scroll-margin-top: var(--nav-h);    /* belt-and-braces anchor offset */
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 64px;
}

.section-label {
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  white-space: nowrap;
}

.section-rule { flex: 1; height: 1px; background: var(--border); }

/* ── ABOUT ── */
#about .about-text {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.75;
  color: #ffffff;
  font-weight: 300;
  margin: 0 auto;
  text-align: center;
}

#about .about-text p + p { margin-top: 24px; }

/* ── PORTFOLIO ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.portfolio-tile {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: default;
  background: #1a1a1a;
}

.portfolio-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.4s;
  filter: grayscale(20%) brightness(0.85);
}

.portfolio-tile:hover img { transform: scale(1.04); filter: grayscale(0%) brightness(0.7); }

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s;
}

.portfolio-tile:hover .tile-overlay,
.portfolio-tile.touch-active .tile-overlay { opacity: 1; }

.portfolio-tile:hover .tile-name-static,
.portfolio-tile.touch-active .tile-name-static { opacity: 0; }

.portfolio-tile.touch-active img { transform: scale(1.04); filter: grayscale(0%) brightness(0.7); }

.tile-name-static {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  font-weight: 400;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  transition: opacity 0.3s;
}

.tile-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 6px;
}

.tile-status {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,242,237,0.65);
}

.tile-status.existing { color: var(--cream); }
.tile-status.realized { color: rgba(255,255,255,0.9); }

/* ── PORTFOLIO DIVIDER ── */
.portfolio-divider {
  grid-column: 1 / -1;
  padding: 28px 0;              /* robust height at every breakpoint (was a vw calc) */
  display: flex;
  align-items: center;
  gap: 16px;
}

.portfolio-divider-label {
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  white-space: nowrap;
}

.portfolio-divider-line { flex: 1; height: 1px; background: var(--border); }

/* ── TEAM ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.team-card {
  background: #111;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  transition: background 0.25s;
}

.team-card:hover { background: #161616; }

.team-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #222;
  margin-bottom: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-photo svg { opacity: 0.3; }

.team-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.2;
}

.team-title {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 16px;
  line-height: 1.4;
}

.team-linkedin {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0a66c2;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}

.team-linkedin:hover { color: #004182; }

.linkedin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #a8a49e;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.linkedin-badge svg { flex-shrink: 0; }

/* ── FOOTER ── */
footer {
  padding: 56px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  border-top: 1px solid var(--border);
}

.footer-logo {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-legal {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--mid);
  line-height: 1.8;
  max-width: 340px;
}

.footer-contact { text-align: right; }

.footer-address {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--mid);
  line-height: 1.9;
  margin-bottom: 16px;
}

.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.footer-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}

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

/* ── LIGHT SECTIONS (about / portfolio / team / footer) ── */
#about, #portfolio, #team, footer { background: #f5f2ed; color: #0e0e0e; }
#about .about-text { color: #0e0e0e; }
#about .section-label { color: #555550; }
#about .section-rule { background: rgba(10,10,10,0.12); }
#portfolio .section-label, #team .section-label { color: #555550; }
#portfolio .section-rule, #team .section-rule { background: rgba(10,10,10,0.12); }
#portfolio .portfolio-divider-label { color: #555550; }
#portfolio .portfolio-divider-line { background: rgba(10,10,10,0.12); }
#team .team-card { background: #e8e4de; }
#team .team-card:hover { background: #dedad4; }
#team .team-name { color: #0e0e0e; }
#team .team-title { color: #555550; }
#team .team-photo { background: #ccc8c2; }
#team .team-photo svg { stroke: #555550; }
#team .team-linkedin { color: #555550; }
#team .team-linkedin:hover { color: #0e0e0e; }
#team .team-linkedin:hover .linkedin-badge { background: #333330; }
footer { border-top: 1px solid rgba(10,10,10,0.12); }
footer .footer-logo { color: #0e0e0e; }
footer .footer-legal, footer .footer-address, footer .footer-links a { color: #555550; }
footer .footer-links a:hover { color: #0e0e0e; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .nav-brand { font-size: 18px; }
  .nav-links { gap: 20px; }
  #hero { padding: calc(var(--nav-h) + 32px) 24px 60px; }
  section { padding: 72px 24px; }
  .hero-logo { font-size: clamp(51px, 13vw, 128px); }
  .hero-stats { flex-direction: column; gap: 28px; align-items: center; width: 100%; max-width: 280px; margin: 0 auto; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 24px; margin-right: 0; width: 100%; text-align: center; padding-right: 0; }
  .stat:last-child { border-bottom: none; }
  .stat-number, .stat-label { text-align: center; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; }
  .footer-contact { text-align: left; }
  .footer-links { align-items: flex-start; }
}

/* small phones — keep the nav on one row + comfortable tap targets */
@media (max-width: 480px) {
  nav { padding: 0 16px; }
  .nav-brand { font-size: 16px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 10px; letter-spacing: 0.12em; }
  section { padding: 60px 20px; }
  .section-header { gap: 14px; margin-bottom: 44px; }
  #about .about-text { font-size: 16px; }
}
