/* =========================================================
   PhysAlgo — page d'accueil moderne
   Fichier autonome : aucun Bootstrap nécessaire.
   ========================================================= */

:root {
  --bg: #07111d;
  --bg-soft: #0b1726;
  --surface: rgba(15, 29, 46, 0.78);
  --surface-strong: #101f31;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f6f2e8;
  --muted: #aeb8c4;
  --gold: #d8aa58;
  --gold-light: #f3d18b;
  --cyan: #54d6d1;
  --blue: #61a7ff;
  --violet: #a981ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.30);
  --radius: 24px;
  --shell: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(84, 214, 209, 0.07), transparent 26rem),
    radial-gradient(circle at 85% 20%, rgba(216, 170, 88, 0.08), transparent 28rem),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  font: inherit;
}

img,
svg,
canvas {
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 2rem), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  transform: translateY(-180%);
  padding: .7rem 1rem;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 800;
}

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

/* Navigation ------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 17, 29, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(calc(100% - 2rem), var(--shell));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 209, 139, 0.5);
  border-radius: 50%;
  color: #17120b;
  background:
    linear-gradient(145deg, var(--gold-light), #b77d34);
  box-shadow:
    inset 0 0 0 4px rgba(84, 50, 12, 0.18),
    0 8px 28px rgba(216, 170, 88, 0.16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: .04em;
}

.brand-text small {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.nav-link,
.nav-dropdown > summary {
  padding: .7rem .86rem;
  border-radius: 10px;
  color: #dfe7ef;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-dropdown > summary:hover,
.nav-dropdown > summary:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  outline: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "⌄";
  margin-left: .42rem;
  color: var(--gold-light);
}

.nav-dropdown[open] > summary {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: min(330px, calc(100vw - 2rem));
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 26, 42, 0.98);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .38);
}

.dropdown-panel a,
.dropdown-panel span {
  display: block;
  padding: .72rem .8rem;
  border-radius: 10px;
  color: #d8e1eb;
  text-decoration: none;
  font-size: .9rem;
}

.dropdown-panel a:hover,
.dropdown-panel a:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  outline: none;
}

.dropdown-panel--info span {
  color: var(--muted);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: .7rem;
  padding: .62rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.menu-toggle__icon,
.menu-toggle__icon::before,
.menu-toggle__icon::after {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
}

.menu-toggle__icon {
  position: relative;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle__icon::before {
  top: -6px;
}

.menu-toggle__icon::after {
  top: 6px;
}

/* Accueil compact -------------------------------------------- */

main {
  min-height: calc(100svh - 70px - 48px);
  display: flex;
}

.home-panel {
  flex: 1;
  min-height: 0;
  padding-block: clamp(1.1rem, 2.8vh, 2.2rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(.85rem, 2vh, 1.35rem);
}

.home-panel__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.home-panel__heading .eyebrow {
  margin-bottom: .35rem;
}

.home-panel__heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4vw, 3.45rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.home-panel__intro {
  max-width: 390px;
  margin: 0 0 .25rem;
  color: var(--muted);
  text-align: right;
  font-size: clamp(.82rem, 1.2vw, .95rem);
}

.eyebrow {
  margin: 0;
  color: var(--gold-light);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.access-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(130px, 1fr));
  gap: clamp(.7rem, 1.8vh, 1rem);
}

.access-button {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: clamp(1rem, 2.2vw, 1.55rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(.8rem, 1.8vw, 1.2rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  text-decoration: none;
  transition:
    transform .2s ease,
    border-color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

.access-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cyan);
}

.access-button--phy::before { background: var(--blue); }
.access-button--qalgo::before { background: var(--violet); }
.access-button--dariush::before { background: var(--gold); }

.access-button::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -75px;
  bottom: -100px;
  border-radius: 50%;
  opacity: .10;
  background: var(--cyan);
  transition: transform .25s ease, opacity .25s ease;
}

.access-button--phy::after { background: var(--blue); }
.access-button--qalgo::after { background: var(--violet); }
.access-button--dariush::after { background: var(--gold); }

.access-button:hover,
.access-button:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.22);
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  outline: none;
}

.access-button:hover::after,
.access-button:focus-visible::after {
  transform: scale(1.18);
  opacity: .17;
}

.access-button__icon {
  position: relative;
  z-index: 1;
  width: clamp(48px, 5vw, 66px);
  height: clamp(48px, 5vw, 66px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 17px;
  background: rgba(255,255,255,.055);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 900;
}

.access-button__icon--seal {
  border-color: rgba(216,170,88,.3);
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.access-button__text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .18rem;
}

.access-button__text strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.05;
}

.access-button__text small {
  color: var(--muted);
  font-size: clamp(.76rem, 1.1vw, .9rem);
}

.access-button__arrow {
  position: relative;
  z-index: 1;
  color: var(--gold-light);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  transition: transform .2s ease;
}

.access-button:hover .access-button__arrow,
.access-button:focus-visible .access-button__arrow {
  transform: translateX(4px);
}

.home-note {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  color: #7f8d9b;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-note span:first-child {
  color: var(--gold-light);
}

.site-footer--compact {
  border-top: 1px solid var(--line);
  background: #050d16;
}

.footer-bottom--compact {
  min-height: 48px;
  padding: .65rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #778593;
  font-size: .74rem;
}

.footer-bottom--compact a {
  color: #aab6c2;
  text-decoration: none;
}

.footer-bottom--compact a:hover,
.footer-bottom--compact a:focus-visible {
  color: #fff;
}

/* Responsive ------------------------------------------------ */

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 1rem;
    right: 1rem;
    display: none;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    background: rgba(7, 17, 29, .98);
    box-shadow: 0 24px 55px rgba(0,0,0,.36);
  }

  .main-nav.is-open {
    display: block;
  }

  .nav-link,
  .nav-dropdown > summary {
    display: block;
    width: 100%;
  }

  .nav-dropdown,
  .dropdown-panel {
    width: 100%;
  }

  .dropdown-panel {
    position: static;
    margin-top: .25rem;
    border-color: rgba(255,255,255,.07);
    box-shadow: none;
    background: rgba(255,255,255,.03);
  }

  main {
    min-height: calc(100svh - 68px - 44px);
  }

  .home-panel {
    padding-block: .95rem;
    gap: .8rem;
  }

  .home-panel__heading {
    align-items: start;
    flex-direction: column;
    gap: .35rem;
  }

  .home-panel__intro {
    max-width: none;
    text-align: left;
  }

  .footer-bottom--compact {
    min-height: 44px;
  }
}

@media (max-width: 680px) {
  .shell,
  .nav-shell {
    width: min(calc(100% - 1rem), var(--shell));
  }

  .nav-shell {
    min-height: 62px;
  }

  main {
    min-height: calc(100svh - 62px);
  }

  .home-panel {
    padding-block: .75rem;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .home-panel__heading h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .home-panel__intro,
  .home-note,
  .site-footer--compact {
    display: none;
  }

  .access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }

  .access-button {
    padding: .85rem;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    align-content: center;
    gap: .55rem;
    border-radius: 17px;
  }

  .access-button__icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .access-button__text {
    grid-column: 1 / -1;
    align-self: end;
  }

  .access-button__text strong {
    font-size: clamp(1rem, 5vw, 1.35rem);
  }

  .access-button__text small {
    font-size: .68rem;
    line-height: 1.25;
  }

  .access-button__arrow {
    grid-column: 2;
    grid-row: 1;
  }

  .brand-text small,
  .menu-toggle__label {
    display: none;
  }

  .main-nav {
    left: .5rem;
    right: .5rem;
  }
}

@media (max-height: 650px) and (min-width: 681px) {
  .nav-shell {
    min-height: 60px;
  }

  main {
    min-height: calc(100svh - 60px - 40px);
  }

  .home-panel {
    padding-block: .65rem;
    gap: .6rem;
  }

  .home-panel__heading h1 {
    font-size: 2rem;
  }

  .home-panel__intro {
    font-size: .78rem;
  }

  .access-grid {
    gap: .6rem;
  }

  .access-button {
    padding: .8rem 1rem;
  }

  .access-button__icon {
    width: 46px;
    height: 46px;
  }

  .access-button__text strong {
    font-size: 1.3rem;
  }

  .home-note {
    display: none;
  }

  .footer-bottom--compact {
    min-height: 40px;
    padding: .35rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
