/* ==========================================================================
   www.lantran.dev — home
   Full-screen product sections that snap on scroll: name and one line at the
   top, two actions at the bottom, the product filling everything between.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080808;
  --text: #f5f5f5;
  --text-2: #a6a6a6;
  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--bg);
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

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

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

/* ---- navigation ------------------------------------------------------------ */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--nav-h);
  padding: 0 clamp(16px, 3vw, 40px);
}

.brand {
  justify-self: start;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-decoration: none;
}

.links {
  display: flex;
  gap: 4px;
}

.links > a,
.menu-trigger,
.nav-end {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 300ms ease;
}

.links > a:hover,
.menu-trigger:hover,
.menu:focus-within .menu-trigger,
.nav-end:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* "Tech" groups the technical projects; its panel opens on hover or keyboard focus. */
.menu {
  position: relative;
}

.menu-trigger {
  display: block;
}

.menu-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  display: grid;
  min-width: 232px;
  margin-top: 8px;
  padding: 10px 8px 8px;
  border-radius: 6px;
  background: rgba(16, 17, 20, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition:
    opacity 200ms ease,
    transform 200ms var(--ease),
    visibility 0s linear 200ms;
}

/* Keeps the panel open while the pointer crosses the gap below the trigger. */
.menu-panel::before {
  content: "";
  position: absolute;
  inset: -10px 0 auto;
  height: 10px;
}

.menu:hover .menu-panel,
.menu:focus-within .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition:
    opacity 200ms ease,
    transform 200ms var(--ease);
}

.menu-label {
  margin: 0 10px 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.menu-panel a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 300ms ease;
}

.menu-panel a:hover,
.menu-panel a:focus-visible {
  background: rgba(255, 255, 255, 0.09);
}

.menu-idx {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.nav-end {
  justify-self: end;
}

/* ---- sections --------------------------------------------------------------- */

.panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  padding: calc(var(--nav-h) + 8vh) 24px calc(9vh + env(safe-area-inset-bottom));
  overflow: hidden;
  text-align: center;
  scroll-snap-align: start;
}

.media,
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.media img {
  object-fit: cover;
  object-position: center;
}

.panel::after {
  /* keeps the type legible where it sits over the image */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8, 8, 8, 0.55) 0%, rgba(8, 8, 8, 0) 30%, rgba(8, 8, 8, 0) 68%, rgba(8, 8, 8, 0.65) 100%);
  pointer-events: none;
}

.copy,
.actions,
.next,
.foot {
  position: relative;
  z-index: 1;
}

.copy {
  display: grid;
  gap: 8px;
}

.copy h2,
.copy h3 {
  margin: 0;
  font-size: clamp(36px, 4.2vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.copy p {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

.copy .eyebrow {
  margin-bottom: -2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.actions {
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 264px;
  height: 44px;
  padding: 0 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition:
    background-color 300ms ease,
    box-shadow 300ms ease;
}

.primary {
  background: #f4f4f4;
  color: #111111;
}

.primary:hover {
  background: #ffffff;
}

.secondary {
  background: rgba(23, 26, 32, 0.62);
  color: #f4f4f4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.secondary:hover {
  background: rgba(44, 48, 56, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.next {
  position: absolute;
  left: 50%;
  bottom: calc(2.5vh + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-2);
  transform: translateX(-50%);
  transition: color 300ms ease;
}

.next:hover {
  color: var(--text);
}

.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 12px;
  color: var(--text-2);
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

/* ---- entrance: only when JS is present ------------------------------------- */

.js .panel .copy,
.js .panel .actions {
  opacity: 0;
  transform: translateY(14px);
}

.js .panel.in .copy {
  animation: rise 900ms var(--ease) forwards;
}

.js .panel.in .actions {
  animation: rise 900ms 160ms var(--ease) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- phones ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .nav {
    grid-template-columns: 1fr auto;
  }
  .links {
    display: none;
  }
  .panel {
    padding-top: calc(var(--nav-h) + 6vh);
    padding-bottom: calc(10vh + env(safe-area-inset-bottom));
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-width: 420px;
  }
  .btn {
    min-width: 0;
    width: 100%;
  }
  #tarot .actions {
    margin-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .panel .copy,
  .js .panel .actions {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}
