/* ==========================================================================
   Make up Nanna West — Digital Business Card
   Pure CSS, mobile first. Tokens → base → background → card → motion.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;

  /* Palette — drawn from the portrait: lilac walls, mustard knit, ink frames */
  --c-bg:          #f5f2f6;
  --c-bg-elev:     #ffffff;
  --c-surface:     rgb(255 255 255 / 0.55);
  --c-surface-hi:  rgb(255 255 255 / 0.85);
  --c-border:      rgb(27 23 32 / 0.08);
  --c-border-hi:   rgb(27 23 32 / 0.16);
  --c-ink:         #1b1720;
  --c-ink-muted:   #5d5566;
  --c-ink-faint:   #8b8293;

  --c-accent:      #e4b31c;  /* mustard */
  --c-accent-hi:   #f0c53d;
  --c-accent-ink:  #1b1720;  /* text on mustard */

  --c-pink:        #ef5ba1;  /* logo hot pink */

  --c-tone-rose:    #ef5ba1;
  --c-tone-mustard: #a07800;
  --c-tone-lilac:   #7a5c8f;
  --c-tone-sage:    #4d7a62;

  --c-glow-1: rgb(196 176 206 / 0.75);
  --c-glow-2: rgb(228 179 28 / 0.28);
  --c-shadow: rgb(52 36 64 / 0.14);

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1:  clamp(1.05rem, 1rem + 0.25vw, 1.2rem);

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --space-xl:  clamp(2.5rem, 2rem + 3vw, 4rem);

  /* Shape & layout */
  --radius-s: 0.75rem;
  --radius-m: 1.125rem;
  --radius-l: 1.75rem;
  --radius-xl: 2.25rem;
  --radius-pill: 999px;
  --card-max: 27rem;
  --blur: 20px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 900ms;
  --stagger: 90ms;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  background-color: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--c-accent);
}

img, svg { display: block; max-width: 100%; }
h1, figure, ul { margin: 0; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

::selection { background: var(--c-accent); color: var(--c-accent-ink); }

:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* ---------- 3. Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;

  /* fine grain texture */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
  }
}

.ambient__orb {
  position: absolute;
  width: 70vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;

  &.ambient__orb--lilac {
    top: -30vmax;
    right: -25vmax;
    background: var(--c-glow-1);
    animation: orb-drift-1 34s var(--ease-in-out) infinite alternate;
  }
  &.ambient__orb--mustard {
    bottom: -35vmax;
    left: -25vmax;
    width: 60vmax;
    background: var(--c-glow-2);
    animation: orb-drift-2 42s var(--ease-in-out) infinite alternate;
  }

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes orb-drift-1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-5vmax, 4vmax, 0) scale(1.05);
  }
  100% {
    transform: translate3d(4vmax, -3vmax, 0) scale(0.96);
  }
}

@keyframes orb-drift-2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(6vmax, -4vmax, 0) scale(0.95);
  }
  100% {
    transform: translate3d(-4vmax, 3vmax, 0) scale(1.06);
  }
}

/* ---------- 4. Page & card layout ---------- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100dvh;
  padding:
    max(var(--space-m), env(safe-area-inset-top))
    max(var(--space-s), env(safe-area-inset-right))
    max(var(--space-m), env(safe-area-inset-bottom))
    max(var(--space-s), env(safe-area-inset-left));
  gap: var(--space-xs);
}

/* Glass Digital Business Card */
.bcard {
  display: grid;
  gap: var(--space-s);
  width: 100%;
  max-width: var(--card-max);
  margin-inline: auto;
  padding: clamp(1.25rem, 0.9rem + 2vw, 2.25rem);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--radius-xl);
  background: var(--c-surface);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    0 32px 64px -24px var(--c-shadow);
}

@media (max-width: 25rem) {
  .page {
    padding-inline: 0.75rem;
  }
  .bcard {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-l);
  }
}

/* ---------- 5. Logo ---------- */
.bcard__logo {
  justify-self: center;
  width: min(78%, 15.5rem);
  margin-bottom: var(--space-xs);

  img {
    width: 100%;
    height: auto;
    margin-inline: auto;
  }
}

/* ---------- 6. Contact rows ---------- */
.contact-list {
  display: grid;
  gap: var(--space-2xs);
  padding: 0;
  list-style: none;
}

.contact {
  --tone: var(--c-pink);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-s);
  min-height: 3.75rem;
  padding: var(--space-2xs) var(--space-s) var(--space-2xs) var(--space-2xs);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  background: var(--c-surface-hi);
  transition:
    translate var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);

  &:hover,
  &:focus-visible {
    translate: 0 -2px;
    border-color: color-mix(in srgb, var(--tone) 45%, transparent);
    background: color-mix(in srgb, var(--tone) 6%, var(--c-bg-elev));
    box-shadow: 0 16px 32px -20px color-mix(in srgb, var(--tone) 60%, transparent);
  }

  &:active { translate: 0 0; scale: 0.99; }
}

.contact__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-s);
  color: var(--c-pink);
  background: color-mix(in srgb, var(--c-pink) 10%, var(--c-bg-elev));
  transition:
    background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    rotate var(--dur-slow) var(--ease-out);

  .contact:hover &,
  .contact:focus-visible & {
    background: var(--c-pink);
    color: #ffffff;
    rotate: -6deg;
  }
}

.contact__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.contact__arrow {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--c-ink-faint);
  transition: translate var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);

  .contact:hover &,
  .contact:focus-visible & {
    translate: 2px -2px;
    color: var(--tone);
  }
}

/* ---------- 8. Primary button (vCard) ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 3.75rem;
  padding: 0 var(--space-m);
  border-radius: var(--radius-pill);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition:
    translate var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);

  .icon { transition: translate var(--dur-base) var(--ease-out); }
  &:active { translate: 0 1px; }
}

.btn--primary {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.45),
    0 1px 2px rgb(0 0 0 / 0.08),
    0 12px 30px -12px rgb(228 179 28 / 0.7);

  /* sweeping sheen */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.55) 50%, transparent 65%);
    translate: -110% 0;
    transition: translate 700ms var(--ease-out);
  }

  &:hover {
    background: var(--c-accent-hi);
    translate: 0 -2px;
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.5),
      0 2px 4px rgb(0 0 0 / 0.08),
      0 20px 40px -14px rgb(228 179 28 / 0.8);
  }
  &:hover::before { translate: 110% 0; }
  &:hover .icon { translate: 0 2px; }
}

/* Wrapper carries the reveal so the button keeps its own snappy transitions */
.bcard__save {
  margin-top: var(--space-2xs);

  .btn { width: 100%; }
}

/* ---------- 9. Footer copyright ---------- */
.bcard-footer {
  font-size: var(--step--1);
  color: var(--c-ink-faint);
  letter-spacing: 0.02em;
  text-align: center;
  user-select: none;
}

/* ---------- 10. Load / scroll reveal (only when JS is running) ---------- */
.js [data-reveal],
.js [data-stagger] > * {
  opacity: 0;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    translate var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out);
  transition-delay: calc((var(--base, 0) + var(--i, 0)) * var(--stagger));

  @media (prefers-reduced-motion: no-preference) {
    translate: 0 1.25rem;
    filter: blur(6px);
  }
}

.js [data-reveal].is-visible,
.js [data-stagger].is-visible > * {
  opacity: 1;
  translate: 0 0;
  filter: none;
}
