@layer reset, base, components, utilities;

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

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ol,
  ul {
    margin: 0;
  }

  ol,
  ul {
    padding: 0;
  }

  img {
    display: block;
    max-width: 100%;
  }

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

@layer base {
  :root {
    color-scheme: dark;
    --bg: #070808;
    --bg-soft: #0d0f0f;
    --surface: #121414;
    --surface-strong: #181a19;
    --line: #2a2d2b;
    --line-soft: rgba(255, 255, 255, 0.1);
    --text: #f4efe6;
    --muted: #b6afa3;
    --muted-strong: #878178;
    --accent: #d8b56a;
    --accent-ink: #15110a;
    --accent-cool: #78b8a8;
    --max: 1120px;
    --radius: 8px;
  }

  body {
    min-height: 100vh;
    overflow-x: clip;
    background:
      linear-gradient(180deg, rgba(120, 184, 168, 0.04), transparent 26rem),
      var(--bg);
    color: var(--text);
    font-family:
      Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
      sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
  }

  body::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    content: "";
    background:
      radial-gradient(
        540px circle at var(--pointer-x, 50%) var(--pointer-y, 18%),
        rgba(216, 181, 106, 0.13),
        rgba(120, 184, 168, 0.06) 28%,
        transparent 62%
      );
    opacity: var(--pointer-opacity, 0.52);
    pointer-events: none;
  }

  main,
  .site-footer,
  .auth-gate {
    position: relative;
    z-index: 1;
  }

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

@layer components {
  .wrap {
    width: min(calc(100% - 40px), var(--max));
    margin-inline: auto;
  }

  .skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 20;
    transform: translateY(-160%);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.65rem 0.9rem;
    font-weight: 700;
    transition: transform 180ms ease;
  }

  .skip-link:focus {
    transform: translateY(0);
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    border-bottom: 1px solid transparent;
    background: rgba(7, 8, 8, 0.54);
    backdrop-filter: blur(18px);
    transition:
      background 180ms ease,
      border-color 180ms ease;
  }

  body.auth-required {
    overflow: hidden;
  }

  body.auth-required .skip-link,
  body.auth-required .site-header,
  body.auth-required main,
  body.auth-required .site-footer {
    display: none;
  }

  body.is-authenticated {
    overflow: auto;
  }

  body.is-authenticated .auth-gate {
    display: none;
  }

  .auth-gate {
    display: grid;
    min-height: 100svh;
    overflow: hidden;
    padding: 2rem;
    place-items: center;
  }

  .auth-gate::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background:
      linear-gradient(90deg, #070808 0%, rgba(7, 8, 8, 0.94) 42%, rgba(7, 8, 8, 0.62) 100%),
      linear-gradient(0deg, rgba(7, 8, 8, 0.96), rgba(7, 8, 8, 0.36));
    pointer-events: none;
  }

  .auth-gate__background {
    position: absolute;
    inset: 0 0 0 44%;
    opacity: 0.52;
  }

  .auth-gate__background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    filter: grayscale(100%) contrast(1.05);
  }

  .auth-gate__panel {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 420px);
    gap: 4rem;
    width: min(100%, var(--max));
    align-items: center;
  }

  .auth-gate__intro {
    max-width: 660px;
  }

  .auth-gate h1 {
    margin-top: 0.7rem;
    font-size: 4.6rem;
    line-height: 0.98;
    letter-spacing: 0;
  }

  .auth-gate__intro p:not(.eyebrow) {
    max-width: 560px;
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: 1.14rem;
  }

  .auth-card {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(18, 20, 20, 0.82);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
    padding: 1.15rem;
    backdrop-filter: blur(18px);
  }

  .auth-form,
  .request-form {
    display: grid;
    gap: 0.85rem;
  }

  .auth-form label,
  .request-form label {
    display: grid;
    gap: 0.35rem;
  }

  .auth-form span,
  .request-form span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .auth-form input,
  .request-form input,
  .request-form textarea {
    width: 100%;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
    outline: none;
    padding: 0.78rem 0.85rem;
    transition:
      background 160ms ease,
      border-color 160ms ease,
      box-shadow 160ms ease;
  }

  .auth-form input:focus,
  .request-form input:focus,
  .request-form textarea:focus {
    border-color: rgba(216, 181, 106, 0.62);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 4px rgba(216, 181, 106, 0.08);
  }

  .auth-note {
    color: var(--muted-strong);
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .auth-note.is-error {
    color: #efb0a3;
  }

  .auth-note.is-success {
    color: var(--accent-cool);
  }

  .access-request {
    margin-top: 1rem;
    border-top: 1px solid var(--line-soft);
    padding-top: 1rem;
  }

  .access-request summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 800;
  }

  .request-form {
    margin-top: 0.9rem;
  }

  .site-header::before {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-cool), transparent);
    opacity: 0.9;
    transform: scaleX(var(--scroll-progress, 0));
    transform-origin: left center;
  }

  .site-header.is-scrolled {
    border-color: var(--line-soft);
    background: rgba(7, 8, 8, 0.86);
  }

  .header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(calc(100% - 40px), var(--max));
    min-height: 72px;
    margin-inline: auto;
  }

  .brand {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.92rem;
  }

  .site-nav a,
  .header__contact {
    position: relative;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    overflow: hidden;
    transition:
      background 160ms ease,
      color 160ms ease,
      transform 180ms ease;
  }

  .site-nav a::after {
    position: absolute;
    right: 0.75rem;
    bottom: 0.42rem;
    left: 0.75rem;
    height: 1px;
    content: "";
    background: currentColor;
    opacity: 0.55;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 220ms ease;
  }

  .site-nav a:hover,
  .site-nav a:focus-visible,
  .header__contact:hover,
  .header__contact:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }

  .site-nav a:hover::after,
  .site-nav a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left center;
  }

  .header__contact {
    border: 1px solid var(--line-soft);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
  }

  .hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 82svh;
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
    padding: 8.5rem 0 3rem;
  }

  .hero::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background:
      linear-gradient(90deg, #070808 0%, #070808 38%, rgba(7, 8, 8, 0.76) 55%, rgba(7, 8, 8, 0.18) 100%),
      linear-gradient(0deg, #070808 0%, rgba(7, 8, 8, 0.2) 34%, transparent 100%);
    pointer-events: none;
  }

  .hero__media {
    position: absolute;
    inset: 0 0 0 42%;
    z-index: 0;
  }

  .hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    filter: grayscale(100%) contrast(1.04);
    transform: translate3d(var(--hero-shift-x, 0), var(--hero-shift-y, 0), 0) scale(1.035);
    transition: transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
  }

  .hero__inner {
    position: relative;
    z-index: 2;
  }

  .hero__inner > * {
    animation: fade-rise 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .hero__inner > *:nth-child(2) {
    animation-delay: 80ms;
  }

  .hero__inner > *:nth-child(3) {
    animation-delay: 160ms;
  }

  .hero__inner > *:nth-child(4) {
    animation-delay: 230ms;
  }

  .hero__inner > *:nth-child(5) {
    animation-delay: 310ms;
  }

  .hero__inner > *:nth-child(6) {
    animation-delay: 390ms;
  }

  .eyebrow {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .hero h1 {
    margin-top: 0.6rem;
    font-size: 5.4rem;
    line-height: 0.95;
    letter-spacing: 0;
  }

  .hero__lead {
    max-width: 680px;
    margin-top: 1.1rem;
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .hero__text {
    max-width: 610px;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 1.04rem;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.8rem;
  }

  .button {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    overflow: hidden;
    font-weight: 800;
    isolation: isolate;
    line-height: 1.1;
    transform: translate3d(var(--magnet-x, 0), var(--magnet-y, 0), 0);
    transition:
      border-color 160ms ease,
      background 160ms ease,
      color 160ms ease,
      box-shadow 180ms ease,
      transform 180ms ease;
    will-change: transform;
  }

  .button::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background:
      radial-gradient(
        110px circle at var(--button-x, 50%) var(--button-y, 50%),
        rgba(255, 255, 255, 0.24),
        transparent 62%
      );
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .button:hover,
  .button:focus-visible {
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
    transform: translate3d(var(--magnet-x, 0), calc(var(--magnet-y, 0) - 1px), 0);
  }

  .button:hover::before,
  .button:focus-visible::before {
    opacity: 1;
  }

  .button--primary {
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-ink);
  }

  .button--primary:hover,
  .button--primary:focus-visible {
    background: #edc87e;
  }

  .button--quiet {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
  }

  .button--quiet:hover,
  .button--quiet:focus-visible {
    border-color: rgba(216, 181, 106, 0.55);
    background: rgba(216, 181, 106, 0.1);
  }

  .hero__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 860px;
    margin-top: 2.2rem;
    list-style: none;
  }

  .hero__facts li {
    border-top: 1px solid var(--line-soft);
    padding-top: 0.9rem;
    transition:
      border-color 180ms ease,
      transform 180ms ease;
  }

  .hero__facts li:hover {
    border-color: rgba(216, 181, 106, 0.45);
    transform: translateY(-2px);
  }

  .hero__facts span,
  .metrics span {
    display: block;
    color: var(--muted-strong);
    font-size: 0.84rem;
  }

  .hero__facts strong,
  .metrics strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.35;
  }

  .section {
    padding: 6.8rem 0;
  }

  .section--intro,
  .section--programs {
    background: var(--bg-soft);
  }

  .section--intro {
    padding-top: 1.6rem;
  }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 4rem;
  }

  .split--center {
    align-items: center;
  }

  .section__heading {
    max-width: 460px;
  }

  .section__heading--wide {
    max-width: 760px;
    margin-bottom: 2.4rem;
  }

  .section__heading h2 {
    margin-top: 0.65rem;
    font-size: 2.7rem;
    line-height: 1.08;
    letter-spacing: 0;
  }

  .profile-copy,
  .feature-list,
  .contact__content {
    color: var(--muted);
    font-size: 1.05rem;
  }

  .profile-copy p + p,
  .feature-list p + ul {
    margin-top: 1.1rem;
  }

  .metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.2rem;
  }

  .metrics div {
    border-top: 1px solid var(--line-soft);
    padding-top: 0.9rem;
    transition:
      border-color 180ms ease,
      transform 180ms ease;
  }

  .metrics div:hover {
    border-color: rgba(120, 184, 168, 0.42);
    transform: translateY(-2px);
  }

  .metrics strong {
    color: var(--accent-cool);
    font-size: 1.1rem;
  }

  .timeline {
    border-top: 1px solid var(--line-soft);
    list-style: none;
  }

  .timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 2rem;
    border-bottom: 1px solid var(--line-soft);
    padding: 1.6rem 0;
    transition:
      border-color 180ms ease,
      padding-left 180ms ease;
  }

  .timeline li::before {
    position: absolute;
    top: 1.6rem;
    bottom: 1.6rem;
    left: 0;
    width: 2px;
    content: "";
    background: linear-gradient(var(--accent), var(--accent-cool));
    opacity: 0;
    transform: scaleY(0.5);
    transform-origin: top center;
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  .timeline li:hover {
    border-color: rgba(216, 181, 106, 0.28);
    padding-left: 0.85rem;
  }

  .timeline li:hover::before {
    opacity: 1;
    transform: scaleY(1);
  }

  .timeline time {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 800;
  }

  .timeline h3,
  .skill-card h3,
  .program-card h3 {
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .timeline p,
  .skill-card p,
  .program-card p {
    margin-top: 0.45rem;
    color: var(--muted);
  }

  .skill-grid,
  .program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .skill-card,
  .program-card {
    position: relative;
    min-height: 168px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    padding: 1.2rem;
    transform:
      perspective(900px)
      rotateX(var(--tilt-y, 0deg))
      rotateY(var(--tilt-x, 0deg))
      translateY(var(--lift, 0));
    transform-style: preserve-3d;
    transition:
      background 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      transform 180ms ease;
    will-change: transform;
  }

  .skill-card::before,
  .program-card::before {
    position: absolute;
    inset: -1px;
    content: "";
    background:
      radial-gradient(
        260px circle at var(--card-x, 50%) var(--card-y, 50%),
        rgba(216, 181, 106, 0.18),
        rgba(120, 184, 168, 0.08) 36%,
        transparent 68%
      );
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .skill-card:hover,
  .program-card:hover {
    --lift: -4px;
    border-color: rgba(216, 181, 106, 0.38);
    background: #151716;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  }

  .skill-card:hover::before,
  .program-card:hover::before {
    opacity: 1;
  }

  .skill-card h3,
  .skill-card p,
  .program-card h3,
  .program-card p,
  .program-card__status {
    position: relative;
    z-index: 1;
  }

  .program-card__status {
    display: inline-flex;
    width: fit-content;
    border: 1px solid rgba(216, 181, 106, 0.25);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    padding: 0.42rem 0.55rem;
    text-transform: uppercase;
  }

  .program-card--featured {
    grid-column: span 2;
  }

  .program-card__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .feature-list ul {
    display: grid;
    gap: 0.75rem;
    list-style: none;
  }

  .feature-list li {
    position: relative;
    border-top: 1px solid var(--line-soft);
    padding-top: 0.75rem;
    color: var(--text);
  }

  .contact-band {
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-strong);
  }

  .contact {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 4rem;
    align-items: center;
  }

  .contact h2 {
    margin-top: 0.65rem;
    font-size: 3.6rem;
    line-height: 1;
    letter-spacing: 0;
  }

  .contact__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .site-footer {
    color: var(--muted-strong);
    font-size: 0.92rem;
  }

  .footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 88px;
  }

  .footer__inner a {
    color: var(--muted);
  }
}

@layer utilities {
  .reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(22px);
    transition:
      filter 680ms cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 680ms cubic-bezier(0.2, 0.8, 0.2, 1),
      transform 680ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .reveal.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }

  .timeline .reveal:nth-child(2),
  .skill-grid .reveal:nth-child(2),
  .program-grid .reveal:nth-child(2),
  .metrics div:nth-child(2) {
    transition-delay: 70ms;
  }

  .timeline .reveal:nth-child(3),
  .skill-grid .reveal:nth-child(3),
  .program-grid .reveal:nth-child(3),
  .metrics div:nth-child(3) {
    transition-delay: 140ms;
  }

  .skill-grid .reveal:nth-child(4) {
    transition-delay: 40ms;
  }

  .skill-grid .reveal:nth-child(5) {
    transition-delay: 110ms;
  }

  .skill-grid .reveal:nth-child(6) {
    transition-delay: 180ms;
  }
}

@keyframes fade-rise {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .hero {
    display: block;
    min-height: auto;
    padding: 0 0 3.8rem;
  }

  .hero::after {
    background:
      linear-gradient(0deg, #070808 0%, rgba(7, 8, 8, 0.92) 42%, rgba(7, 8, 8, 0.1) 100%),
      linear-gradient(90deg, rgba(7, 8, 8, 0.72), rgba(7, 8, 8, 0.12));
  }

  .hero__media {
    position: relative;
    inset: auto;
    height: 58svh;
    min-height: 360px;
  }

  .hero__media img {
    object-position: center top;
  }

  .hero__inner {
    margin-top: -6rem;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero__lead {
    font-size: 1.25rem;
  }

  .split,
  .contact {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .section__heading {
    max-width: 680px;
  }

  .section__heading h2 {
    font-size: 2.2rem;
  }

  .skill-grid,
  .program-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-gate__panel {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .auth-gate h1 {
    font-size: 3.6rem;
  }

  .auth-gate__background {
    inset: 0;
  }
}

@media (max-width: 640px) {
  .wrap,
  .header__inner {
    width: min(calc(100% - 32px), var(--max));
  }

  .header__inner {
    min-height: 64px;
  }

  .brand {
    font-size: 0.92rem;
  }

  .header__contact {
    display: none;
  }

  .hero__media {
    height: 50svh;
    min-height: 310px;
  }

  .hero h1 {
    font-size: 3.05rem;
  }

  .hero__lead {
    font-size: 1.12rem;
  }

  .actions,
  .contact__links {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__facts,
  .metrics,
  .skill-grid,
  .program-grid {
    grid-template-columns: 1fr;
  }

  .program-card--featured {
    grid-column: auto;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section__heading--wide {
    margin-bottom: 1.6rem;
  }

  .section__heading h2 {
    font-size: 1.9rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .skill-card {
    min-height: auto;
  }

  .program-card {
    min-height: auto;
  }

  .auth-gate {
    align-items: start;
    padding: 1rem;
  }

  .auth-gate__panel {
    padding-top: 3.5rem;
  }

  .auth-gate h1 {
    font-size: 2.8rem;
  }

  .auth-gate__intro p:not(.eyebrow) {
    font-size: 1rem;
  }

  .contact h2 {
    font-size: 2.8rem;
  }

  .footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  body::before {
    display: none;
  }

  .hero__media img,
  .button,
  .skill-card,
  .program-card {
    transform: none !important;
  }

  .reveal {
    filter: none;
    opacity: 1;
    transform: none;
  }
}
