/* =============================================================================
   DeenKonnect — style.css

   Contents
   01. Design tokens
   02. Reset & base
   03. Utilities
   04. Layout shell
   05. Buttons
   06. Header
   07. Hero
   08. Sections (About, Features)
   09. Launch + countdown
   10. Subscribe form
   11. Footer
   12. Motion (reveal animations)
   13. Responsive
   ============================================================================= */


/* 01. Design tokens ========================================================= */

:root {
  /* Colour */
  --emerald:        #0F6D4A;
  --emerald-deep:   #0A5238;
  --emerald-soft:   rgba(15, 109, 74, 0.08);
  --navy:           #143642;
  --navy-deep:      #0D242C;
  --gold:           #D4AF37;
  --gold-soft:      rgba(212, 175, 55, 0.28);
  --off-white:      #FAFAF7;
  --light-gray:     #F3F4F6;
  --text:           #333333;
  --text-muted:     #5D6970;
  --text-on-dark:   #E7ECEA;
  --success:        #28A745;
  --error:          #DC3545;
  --hairline:       rgba(20, 54, 66, 0.12);

  /* Type */
  --font-display: "Cairo", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.12vw, 0.88rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2:  clamp(1.5rem, 1.32rem + 0.9vw, 2.05rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.4rem);

  /* Space */
  --space-xs:  0.5rem;
  --space-sm:  0.85rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: clamp(4.5rem, 3rem + 6vw, 8rem);

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shell:     1140px;

  /* Elevation — soft, low-contrast, never heavy */
  --shadow-sm: 0 1px 2px rgba(20, 54, 66, 0.04), 0 4px 14px rgba(20, 54, 66, 0.05);
  --shadow-md: 0 2px 6px rgba(20, 54, 66, 0.05), 0 18px 40px rgba(20, 54, 66, 0.08);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* 02. Reset & base ========================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--off-white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
}

p { margin: 0; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--emerald);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--emerald-deep); }

/* One consistent, visible focus ring across the whole page. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}


/* 03. Utilities ============================================================= */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--emerald);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* Spam trap — off-screen rather than display:none, which some bots skip. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.eyebrow {
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
}
.eyebrow--onDark { color: var(--gold); }


/* 04. Layout shell ========================================================== */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding-block: var(--space-2xl); }

.section__title {
  font-size: var(--step-2);
  margin-bottom: var(--space-md);
}
.section__title--onDark { color: #fff; }


/* 05. Buttons =============================================================== */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease),
              box-shadow 0.2s var(--ease),
              background-color 0.2s var(--ease),
              border-color 0.2s var(--ease),
              color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.btn--primary {
  --btn-bg: var(--emerald);
  --btn-fg: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  --btn-bg: var(--emerald-deep);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  --btn-fg: var(--navy);
  border-color: var(--hairline);
  padding-block: 0.6rem;
}
.btn--ghost:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.btn--quiet {
  --btn-fg: var(--navy);
  padding-inline: 0.4rem;
  position: relative;
}
/* A gold hairline that draws itself in on hover — the page's one recurring flourish. */
.btn--quiet::after {
  content: "";
  position: absolute;
  left: 0.4rem; right: 0.4rem; bottom: 0.35rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.btn--quiet:hover { color: var(--navy); }
.btn--quiet:hover::after { transform: scaleX(1); }


/* 06. Header ================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* .is-stuck is toggled by app.js once the page scrolls past the hero lip. */
.site-header.is-stuck {
  border-bottom-color: var(--hairline);
  box-shadow: 0 1px 20px rgba(20, 54, 66, 0.05);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--emerald);
}
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.brand__name--onDark { color: #fff; }

.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.header__nav a {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.header__nav a:hover { color: var(--navy); }
.header__cta { font-size: var(--step--1); }


/* 07. Hero ================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 2rem + 8vw, 7rem) var(--space-2xl);
  overflow: hidden;
}

/* Soft emerald wash behind the hero — no artwork, just light. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(15, 109, 74, 0.10), transparent 60%),
    radial-gradient(90% 70% at 95% 5%, rgba(212, 175, 55, 0.10), transparent 55%);
}

/* The signature: an oversized hairline khatim star, cropped by the viewport edge. */
.hero__motif {
  position: absolute;
  top: -12%;
  right: -14%;
  z-index: -1;
  width: min(60vw, 620px);
  aspect-ratio: 1;
  color: var(--gold);
  opacity: 0.32;
  pointer-events: none;
  animation: motif-in 1.6s var(--ease) both;
}
.hero__motif svg { width: 100%; height: 100%; }

.hero__inner { max-width: 44rem; }

.hero__title {
  font-size: var(--step-3);
  margin-bottom: var(--space-md);
}
.hero__title-accent {
  color: var(--emerald);
  position: relative;
  white-space: nowrap;
}
/* Gold underline sits under the accent phrase, not around it. */
.hero__title-accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.12em;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform-origin: left;
  animation: rule-in 0.9s 0.5s var(--ease) both;
}

.hero__lede {
  max-width: 34rem;
  font-size: var(--step-1);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}


/* 08. Sections ============================================================== */

.about {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--light-gray);
}
.about__inner { max-width: 46rem; }
.about__body {
  font-size: var(--step-1);
  color: var(--text-muted);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.card {
  padding: var(--space-md);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease),
              box-shadow 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-soft);
  box-shadow: var(--shadow-md);
}

.card__icon {
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-sm);
  padding: 0;
  color: var(--emerald);
}

.card__title {
  font-size: var(--step-1);
  margin-bottom: 0.4rem;
}

.card__body {
  font-size: var(--step--1);
  line-height: 1.7;
  color: var(--text-muted);
}


/* 09. Launch + countdown ==================================================== */

.launch {
  position: relative;
  isolation: isolate;
  background: var(--navy);
  color: var(--text-on-dark);
  overflow: hidden;
}
.launch::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(80% 120% at 50% 0%, rgba(15, 109, 74, 0.42), transparent 65%);
}
.launch__inner {
  max-width: 44rem;
  text-align: center;
}
.launch__body {
  color: rgba(231, 236, 234, 0.78);
  margin-bottom: var(--space-lg);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  max-width: 34rem;
  margin-inline: auto;
}
.countdown[hidden] { display: none; }

.countdown__unit {
  padding: var(--space-sm) 0.4rem;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}
.countdown__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1rem + 2.4vw, 2.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}
.countdown__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}


/* 10. Subscribe form ======================================================== */

.subscribe-section__inner {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}
.subscribe-section__body {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.subscribe { width: 100%; }

.subscribe__row {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.subscribe__row:focus-within {
  border-color: var(--emerald);
  box-shadow: var(--shadow-md);
}

.subscribe__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--step-0);
  color: var(--text);
}
.subscribe__input::placeholder { color: #9AA3A8; }
.subscribe__input:focus { outline: none; }
.subscribe__input:focus-visible { outline: none; }

.subscribe__submit { flex: none; }

/* Field-level error state, mirrored on the row. */
.subscribe.has-error .subscribe__row { border-color: var(--error); }

.subscribe__status {
  min-height: 1.4rem;
  margin-top: 0.7rem;
  font-size: var(--step--1);
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.subscribe__status.is-visible { opacity: 1; transform: none; }
.subscribe__status.is-error { color: var(--error); }
.subscribe__status.is-success { color: var(--success); }

.subscribe__fineprint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.subscribe--inline { max-width: 30rem; }
.subscribe--inline .subscribe__status { text-align: left; }

/* Success card replaces the row once an email lands. */
.subscribe__done {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: var(--space-md);
  text-align: left;
  background: rgba(40, 167, 69, 0.07);
  border: 1px solid rgba(40, 167, 69, 0.28);
  border-radius: var(--radius-md);
  animation: fade-up 0.45s var(--ease) both;
}
.subscribe__done-mark {
  flex: none;
  width: 26px; height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 15px;
  line-height: 26px;
  text-align: center;
}
.subscribe__done-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
}
.subscribe__done-body {
  font-size: var(--step--1);
  color: var(--text-muted);
}


/* 11. Footer ================================================================ */

.site-footer {
  padding-block: var(--space-xl) var(--space-md);
  background: var(--navy-deep);
  color: rgba(231, 236, 234, 0.72);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md) var(--space-lg);
  align-items: start;
}

.footer__brand { grid-row: span 2; }
.site-footer .brand { color: var(--gold); }
.footer__tagline {
  margin-top: 0.6rem;
  font-size: var(--step--1);
  color: rgba(231, 236, 234, 0.6);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: flex-end;
}
.footer__links a {
  font-size: var(--step--1);
  color: rgba(231, 236, 234, 0.72);
}
.footer__links a:hover { color: var(--gold); }

.footer__social {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}
.footer__social a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(231, 236, 234, 0.16);
  border-radius: 50%;
  color: rgba(231, 236, 234, 0.72);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer__social a:hover {
  color: var(--gold);
  border-color: var(--gold-soft);
  transform: translateY(-2px);
}
.footer__social svg { width: 17px; height: 17px; }

.footer__legal {
  grid-column: 1 / -1;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(231, 236, 234, 0.1);
  font-size: 0.78rem;
  color: rgba(231, 236, 234, 0.5);
}


/* 12. Motion ================================================================ */

/* Elements start hidden only when JS is driving the reveal (html.js). */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}
.js .reveal.is-revealed {
  animation: fade-up 0.7s var(--ease) forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes motif-in {
  from { opacity: 0; transform: rotate(-14deg) scale(0.94); }
  to   { opacity: 0.32; transform: rotate(0) scale(1); }
}

@keyframes rule-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .footer__social a:hover { transform: none; }
}


/* 13. Responsive ============================================================ */

/* Large screens: let the shell breathe rather than stretch. */
@media (min-width: 1440px) {
  :root { --shell: 1240px; }
}

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

@media (max-width: 720px) {
  /* Nav links collapse; the CTA stays reachable. */
  .header__nav a:not(.header__cta) { display: none; }

  .hero__title-accent { white-space: normal; }
  .hero__actions { gap: var(--space-sm); }

  .subscribe__row {
    flex-direction: column;
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
  }
  .subscribe__input { padding-inline: 0.5rem; }
  .subscribe__submit { width: 100%; }

  .countdown { grid-template-columns: repeat(2, 1fr); }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .footer__brand { grid-row: auto; }
  .footer__links,
  .footer__social { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .features__grid { grid-template-columns: 1fr; }
  .hero__motif { top: -6%; right: -30%; width: 90vw; opacity: 0.22; }
}
