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

/* ── Hero word-reveal animation ── */
@keyframes wordUp {
  from { transform: translateY(104%); }
  to   { transform: translateY(0); }
}

.hero h1 .word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.0;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  will-change: transform;
}

.hero h1 .word-inner {
  display: inline-block;
  animation: wordUp 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html {
  background: #f0ece8;
}

body {
  font-family: 'Satoshi', 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(-45deg, #f5f0eb, #ede9f2, #f0ece8, #e9edf2, #f2eff5, #ede8e4);
  background-size: 400% 400%;
  animation: pageIn 0.25s ease both, gradientShift 22s ease infinite;
  color: #1d1d1f;
  position: relative;
  overflow-x: hidden;
}

body.fade-out {
  animation: pageOut 0.18s ease forwards;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Blobs (parallax via JS) ── */
.blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.blob-1 {
  width: 750px;
  height: 750px;
  top: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(190, 165, 235, 0.75), rgba(170, 205, 240, 0.45) 55%, transparent 80%);
  filter: blur(60px);
  animation: blobPulse 12s ease-in-out infinite alternate;
}

.blob-2 {
  width: 620px;
  height: 620px;
  bottom: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(240, 190, 165, 0.7), rgba(235, 215, 170, 0.4) 55%, transparent 80%);
  filter: blur(65px);
  animation: blobPulse 16s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  width: 420px;
  height: 420px;
  top: 38%;
  left: 28%;
  background: radial-gradient(circle, rgba(165, 220, 205, 0.5), rgba(180, 210, 235, 0.25) 60%, transparent 80%);
  filter: blur(55px);
  animation: blobPulse 20s ease-in-out infinite alternate;
}

@keyframes blobPulse {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.06); }
}

/* ── Grain overlay ── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23g)' opacity='0.12'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 280px 280px;
}

/* Everything above bg layers */
header, main, section, footer, .page-container {
  position: relative;
  z-index: 10;
}

/* ── Hero ── */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding: 0 64px 80px;
  will-change: transform, opacity;
}

.hero-inner {
  will-change: transform;
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out;
}

.hero h1 {
  font-size: clamp(72px, 14vw, 152px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: #1d1d1f;
  will-change: text-shadow;
}

.hero-tagline {
  margin-top: 28px;
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.hero-tagline.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Story heading word-curtain ── */
.sh-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.05;
}
.sh-inner {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.sh-inner.up { transform: translateY(0); }

/* ── Main / Cards ── */
.main {
  flex: 1;
  padding: 0 24px 72px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  padding: 32px 24px 28px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn 0.4s ease forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.card, .card:visited, .card:hover, .card:focus {
  text-decoration: none;
  outline: none;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.card-icon {
  height: 60px;
  display: flex;
  align-items: center;
}

.card-icon img {
  max-height: 52px;
  max-width: 100px;
  object-fit: contain;
}

.property-icon {
  font-size: 46px;
  line-height: 1;
}

.card h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.card p {
  font-size: 14px;
  color: #6e6e73;
  line-height: 1.6;
  flex: 1;
}

.card-link {
  font-size: 14px;
  font-weight: 700;
  color: #1d1d1f;
  margin-top: 4px;
  text-decoration: none;
}

/* ── Story section ── */
.story {
  display: flex;
  flex-direction: column;
}

.story-line {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 48px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.story-line.revealed {
  opacity: 1;
  transform: translateY(0);
}

.story-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0071e3;
  margin-bottom: 16px;
}

.story-heading {
  font-size: clamp(52px, 11vw, 104px);
  font-weight: 900;
  color: #1d1d1f;
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 20px;
}

.story-heading--big {
  font-size: clamp(34px, 6vw, 62px);
  letter-spacing: -1.5px;
}

.story-body {
  font-size: clamp(15px, 2vw, 18px);
  color: #6e6e73;
  line-height: 1.7;
  max-width: 480px;
  opacity: 0; /* JS reveals via typewriter */
}

.story-line--last {
  gap: 28px;
  align-items: center;
  text-align: center;
}

.story-line--last .btn {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 1.1s, transform 0.6s ease 1.1s;
}

.story-line--last.revealed .btn {
  opacity: 1;
  transform: translateY(0);
}

/* ── Typewriter cursor ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.tw-cursor {
  display: inline-block;
  width: 3px;
  height: 0.82em;
  background: #8a8a8e;
  vertical-align: middle;
  margin-left: 4px;
  border-radius: 1px;
  animation: blink 0.65s step-end infinite;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ── Sub-pages ── */
.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  flex: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #0071e3;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
}

.back-link:hover { text-decoration: underline; }

.page-container h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  color: #1d1d1f;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 12px;
}

.page-container > p {
  font-size: 16px;
  color: #6e6e73;
  margin-bottom: 32px;
  margin-top: 10px;
  line-height: 1.6;
}

.services-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

.services-card table {
  width: 100%;
  border-collapse: collapse;
}

.services-card th {
  background: rgba(0, 0, 0, 0.04);
  padding: 12px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6e6e73;
}

.services-card td {
  padding: 13px 20px;
  font-size: 15px;
  color: #1d1d1f;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ── CTA button ── */
.btn {
  display: inline-block;
  padding: 13px 28px;
  background: #1d1d1f;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.btn-secondary-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-secondary-link:hover {
  color: #1d1d1f;
}

/* ── Responsive hero ── */
@media (max-width: 768px) {
  .hero {
    padding: 0 28px 56px;
    min-height: 88vh;
  }
  .hero-tagline {
    letter-spacing: 0.1em;
  }
}

/* ── Footer ── */
footer {
  background: rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: #6e6e73;
}
