/* ==========================================================================
   grauelmose.css — Grau Elmose Family Website
   Scandinavian / Nordic inspired design
   Primary palette: Black, charcoal grey, white
   Typography: SF Pro / -apple-system stack (Apple.com-style)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables & Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Colour palette */
  --color-bg:           #0a0a0a;   /* near-black background */
  --color-surface:      #111111;   /* card / section surfaces */
  --color-surface-mid:  #1a1a1a;   /* slightly lighter surface */
  --color-border:       #2a2a2a;   /* subtle dividers */
  --color-text:         #f5f5f7;   /* primary text — Apple off-white */
  --color-text-muted:   #86868b;   /* secondary / muted text */
  --color-text-subtle:  #424245;   /* very subtle text */
  --color-accent:       #d4d4d6;   /* accent — cool light grey */
  --color-white:        #ffffff;

  /* Typography — Apple-style system stack */
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont,
                  "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:    "SF Pro Text", -apple-system, BlinkMacSystemFont,
                  "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   2rem;
  --space-lg:   4rem;
  --space-xl:   8rem;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 200ms;
  --duration-med:  400ms;
  --duration-slow: 700ms;

  /* Border radius */
  --radius-sm:  4px;
  --radius-md:  12px;
  --radius-lg:  24px;
}


/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  /* All images rendered in black & white */
  filter: grayscale(100%);
  transition: filter var(--duration-slow) var(--ease-out-expo);
}

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

ul {
  list-style: none;
}

/* --------------------------------------------------------------------------
   3. Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar            { width: 6px; }
::-webkit-scrollbar-track      { background: var(--color-bg); }
::-webkit-scrollbar-thumb      { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }


/* --------------------------------------------------------------------------
   4. Utility Classes
   -------------------------------------------------------------------------- */

/* Fade-in on scroll — initial hidden state */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

/* Applied by JS when element enters viewport */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children reveal delays */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }

/* Horizontal rule / divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

/* Section wrapper */
.section-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* Eyebrow label above headings */
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Section heading */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--color-text);
}

/* Body copy */
.body-copy {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  max-width: 62ch;
}


/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  /* Frosted-glass / blurred dark surface */
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-med) var(--ease-in-out);
}

/* When scrolled — slightly more opaque */
.nav.scrolled {
  background: rgba(10, 10, 10, 0.92);
}

/* Logo / wordmark */
.nav__logo {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
  transition: opacity var(--duration-fast);
}
.nav__logo:hover { opacity: 0.7; }

/* Desktop nav links */
.nav__links {
  display: flex;
  gap: var(--space-md);
}
.nav__links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
  position: relative;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-med) var(--ease-out-expo);
}
.nav__links a:hover       { color: var(--color-text); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Burger menu button (mobile) */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 2px;
}
.nav__burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transform-origin: center;
  transition: transform var(--duration-med) var(--ease-out-expo),
              opacity   var(--duration-fast),
              width     var(--duration-med) var(--ease-out-expo);
}

/* Burger → X animation */
.nav__burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__burger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav__burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav__mobile-menu {
  display: none; /* shown by JS */
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  z-index: 999;
  /* Slide-down animation */
  transform: translateY(-12px);
  opacity: 0;
  transition: transform var(--duration-med) var(--ease-out-expo),
              opacity   var(--duration-med) var(--ease-out-expo);
}
.nav__mobile-menu.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}
.nav__mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.nav__mobile-menu a {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-muted);
  display: block;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--duration-fast), padding-left var(--duration-med) var(--ease-out-expo);
}
.nav__mobile-menu a:hover {
  color: var(--color-text);
  padding-left: 12px;
}


/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  text-align: center;
  padding-bottom: 10vh;
}

/* Hero background image */
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  /* Slight zoom-in on load */
  animation: heroZoom 12s var(--ease-out-expo) forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1.00); }
}

/* Gradient overlay — bottom-heavy vignette */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,10,0.15) 0%,
    rgba(10,10,10,0.20) 40%,
    rgba(10,10,10,0.85) 80%,
    rgba(10,10,10,1.00) 100%
  );
}

/* Hero text content */
.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 var(--space-md);
}

.hero__eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,245,247,0.6);
  margin-bottom: var(--space-sm);
  /* Fade in */
  animation: fadeUp 1s 0.4s var(--ease-out-expo) both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--color-white);
  animation: fadeUp 1s 0.6s var(--ease-out-expo) both;
}

.hero__subtitle {
  margin-top: var(--space-sm);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 300;
  color: rgba(245,245,247,0.65);
  letter-spacing: 0.01em;
  animation: fadeUp 1s 0.8s var(--ease-out-expo) both;
}

/* Scroll cue */
.hero__scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
  animation: fadeUp 1s 1.2s var(--ease-out-expo) both;
}
.hero__scroll-cue span {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
}
.hero__scroll-cue .arrow {
  width: 1px;
  height: 32px;
  background: var(--color-text);
  animation: scrollArrow 1.8s ease-in-out infinite;
}
@keyframes scrollArrow {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

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


/* --------------------------------------------------------------------------
   7. About Section
   -------------------------------------------------------------------------- */
#about {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.about__image-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Slow reveal clip animation on scroll */
.about__image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 1s 0.2s var(--ease-out-expo);
}
.about__image-wrap.revealed::after {
  transform: scaleX(0);
}

.about__image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}
.about__image-wrap:hover img {
  transform: scale(1.03);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Small decorative line */
.about__text .line-accent {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}


/* --------------------------------------------------------------------------
   8. Contact Section
   -------------------------------------------------------------------------- */
#contact {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

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

/* Left — info column */
.contact__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact__info-item .label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  font-weight: 600;
}
.contact__info-item .value {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Social links */
.contact__social {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--duration-fast), gap var(--duration-med) var(--ease-out-expo);
}
.social-link:last-child {
  border-bottom: none;
}
.social-link:hover {
  color: var(--color-text);
  gap: 16px;
}
.social-link svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform var(--duration-med) var(--ease-out-expo);
}
.social-link:hover svg {
  transform: scale(1.15);
}

/* Right — contact form */
.contact__form-wrap {
  background: var(--color-surface-mid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Form row — two columns */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

/* Form group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Input & textarea base */
.form-control {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--duration-fast),
              box-shadow var(--duration-fast);
  width: 100%;
  resize: none;
}
.form-control::placeholder {
  color: var(--color-text-subtle);
}
.form-control:focus {
  border-color: var(--color-text-muted);
  box-shadow: 0 0 0 3px rgba(245,245,247,0.06);
}

textarea.form-control {
  min-height: 130px;
  line-height: 1.6;
}

/* Submit button */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  cursor: pointer;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
  transition: background var(--duration-fast),
              color      var(--duration-fast),
              transform  var(--duration-fast);
}

/* Ripple pseudo-element */
.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  border-radius: inherit;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s var(--ease-out-expo), opacity 0.5s;
}
.btn-submit.ripple::after {
  transform: scale(2.5);
  opacity: 0;
  transition: transform 0.6s var(--ease-out-expo), opacity 0.6s;
}

/* Button active / press */
.btn-submit:active {
  transform: scale(0.97);
}

/* Hover — subtle inversion */
.btn-submit:hover {
  background: var(--color-accent);
}

/* Loading spinner inside button */
.btn-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10,10,10,0.3);
  border-top-color: var(--color-bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-submit.loading .btn-text   { display: none; }
.btn-submit.loading .spinner    { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success / error feedback message */
.form-feedback {
  font-size: 0.875rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
.form-feedback.success {
  display: block;
  background: rgba(60,180,100,0.1);
  border: 1px solid rgba(60,180,100,0.3);
  color: #6ee99e;
}
.form-feedback.error {
  display: block;
  background: rgba(220,60,60,0.1);
  border: 1px solid rgba(220,60,60,0.3);
  color: #f28585;
}


/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-md);
  text-align: center;
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  letter-spacing: 0.02em;
}

.footer__copy a {
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}
.footer__copy a:hover { color: var(--color-text); }


/* --------------------------------------------------------------------------
   10. Grain / Noise Texture Overlay (atmospheric depth)
   -------------------------------------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}


/* --------------------------------------------------------------------------
   11. Responsive — Tablet & Mobile
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 860px) {

  /* Show burger, hide desktop nav links */
  .nav__burger { display: flex; }
  .nav__links  { display: none; }

  /* About — stack vertically */
  .about__grid {
    grid-template-columns: 1fr;
  }
  .about__image-wrap {
    max-width: 480px;
    margin: 0 auto;
  }

  /* Contact — stack vertically */
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 560px) {

  :root {
    --space-lg: 3rem;
    --space-xl: 5rem;
  }

  .section-wrapper {
    padding: var(--space-lg) var(--space-sm);
  }

  /* Form row — single column on small screens */
  .form-row {
    grid-template-columns: 1fr;
  }

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