/* ============================================
   SECTIONS — accueil, à propos, projets, compétences, contact
   ============================================ */

/* ---------- Accents partagés ---------- */
.accent-primary {
    --accent: var(--primary);
    --accent-soft: var(--primary-soft);
    --accent-strong: var(--primary-container);
    --on-accent-strong: var(--on-primary-container);
}

.accent-secondary {
    --accent: var(--secondary);
    --accent-soft: var(--secondary-soft);
    --accent-strong: var(--secondary-container);
    --on-accent-strong: var(--on-secondary-container);
}

.accent-tertiary {
    --accent: var(--tertiary);
    --accent-soft: var(--tertiary-soft);
    --accent-strong: var(--surface-highest);
    --on-accent-strong: var(--tertiary);
}

/* Bordure aurore : le dégradé est peint sous le fond (border-box) et
   n'apparaît que dans la bordure transparente. */
.card {
    padding: var(--space-lg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background:
        linear-gradient(var(--surface-container), var(--surface-container)) padding-box,
        var(--aurora-border) border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* ---------- À propos ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    font-size: var(--text-base);
    line-height: 26px;
    color: var(--on-surface-variant);
}

.about-soft {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-glass);
}

.about-soft .chip { font-size: var(--text-xs); padding: 4px 8px; }

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

.about-fact {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.about-fact-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-fact-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.about-fact-key {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    line-height: 14px;
    color: var(--outline);
}

.about-fact-value {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 22px;
    font-weight: 600;
}

@media (min-width: 1024px) {
    .about-grid { grid-template-columns: 7fr 5fr; }
}

/* ---------- Cadres néon (À propos, Objectif, Contact) ----------
   .neon-frame : fond transparent, contour en tube lumineux. Le cadre lui-même
   porte le tube éteint (contour terne) ; son ::after porte le tube allumé
   (cœur presque blanc + halos), qui grésille quand le cadre (ou son parent
   .reveal) apparaît, puis ronronne doucement. Couleur : --neon ; décalage
   d'allumage : --neon-delay. .neon-icon : pastille d'icône assortie. */
.about-text { --neon: var(--primary); }
.about-fact { --neon: var(--secondary); }
.about-fact:nth-child(3n + 2) { --neon: var(--tertiary); }
.about-fact:nth-child(3n) { --neon: var(--primary); }
.callout { --neon: var(--secondary); }
.contact-card { --neon: var(--accent); }

.neon-frame {
    position: relative;
    background: transparent;
    border: 1.5px solid color-mix(in srgb, var(--neon) 22%, transparent);
    box-shadow: none;
}

.neon-frame::after {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    border: 1.5px solid color-mix(in srgb, var(--neon) 55%, #fff);
    box-shadow:
        0 0 4px color-mix(in srgb, var(--neon) 90%, transparent),
        0 0 14px color-mix(in srgb, var(--neon) 55%, transparent),
        0 0 38px color-mix(in srgb, var(--neon) 22%, transparent),
        inset 0 0 10px color-mix(in srgb, var(--neon) 35%, transparent),
        inset 0 0 28px color-mix(in srgb, var(--neon) 10%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: box-shadow 0.25s, filter 0.25s;
}

/* Allumage en cascade : le texte d'abord, puis chaque encadré. */
.about-fact:nth-child(2) { --neon-delay: 0.15s; }
.about-fact:nth-child(3) { --neon-delay: 0.3s; }
.about-fact:nth-child(4) { --neon-delay: 0.45s; }
.about-fact:nth-child(5) { --neon-delay: 0.6s; }

.visible.neon-frame::after,
.visible .neon-frame::after {
    opacity: 1;
    animation:
        neon-on 1.1s steps(1, end) calc(var(--reveal-delay, 0s) + var(--neon-delay, 0s)) both,
        neon-hum 5s ease-in-out calc(var(--reveal-delay, 0s) + var(--neon-delay, 0s) + 1.2s) infinite;
}

/* Cadres cliquables : ils brillent plus fort au survol. */
:is(.about-fact, .contact-card).neon-frame:hover { background: color-mix(in srgb, var(--neon) 6%, transparent); }
:is(.about-fact, .contact-card).neon-frame:hover::after { filter: brightness(1.3) saturate(1.2); }

.neon-icon {
    border: 1px solid color-mix(in srgb, var(--neon) 45%, transparent);
    background: transparent;
    color: var(--neon);
    text-shadow: 0 0 8px var(--neon);
    box-shadow: 0 0 10px color-mix(in srgb, var(--neon) 30%, transparent),
                inset 0 0 8px color-mix(in srgb, var(--neon) 25%, transparent);
}

@keyframes neon-on {
    0% { opacity: 0; }
    8% { opacity: 0.8; }
    12% { opacity: 0.1; }
    22% { opacity: 0.9; }
    26% { opacity: 0.2; }
    34% { opacity: 1; }
    40% { opacity: 0.4; }
    48%, 100% { opacity: 1; }
}

@keyframes neon-hum {
    0%, 100% { opacity: 1; }
    46% { opacity: 0.86; }
    48% { opacity: 0.6; }
    49% { opacity: 0.92; }
    70% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
    .visible.neon-frame::after,
    .visible .neon-frame::after { animation: none; }
}

/* ---------- Stack & compétences ---------- */
/* Stack : un fichier stack.ts ouvert dans un éditeur (views/skills.js).
   Une ligne de code par groupe ; numéros de ligne en compteur CSS. Les
   technos reliées à des projets sont des boutons qui filtrent les projets.
   Les lignes s'écrivent une à une quand l'éditeur apparaît. */
.stack-editor {
    --gutter: 5ch;
    overflow: hidden;
    border: 1px solid rgba(72, 72, 72, 0.6);
    border-radius: var(--radius-lg);
    background: rgba(10, 10, 10, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    font-family: var(--font-mono);
}

.editor-bar {
    display: flex;
    align-items: stretch;
    gap: var(--space-md);
    height: 38px;
    padding-left: var(--space-md);
    border-bottom: 1px solid rgba(72, 72, 72, 0.6);
    background: rgba(26, 27, 33, 0.9);
}

.editor-dots { display: flex; align-items: center; gap: 7px; }

.editor-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #6e6e6e;
    opacity: 0.75;
}

.editor-dots span:nth-child(2) { background: #9a9a9a; }
.editor-dots span:nth-child(3) { background: #c4c4c4; }

.editor-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
    border-inline: 1px solid rgba(72, 72, 72, 0.6);
    background: rgba(10, 10, 10, 0.9);
    box-shadow: inset 0 2px 0 var(--primary);
    font-size: var(--text-xs);
    color: var(--on-surface);
}

.editor-tab-lang {
    padding: 0 4px;
    border-radius: 3px;
    background: var(--secondary);
    color: #0a0a0a;
    font-size: 10px;
    line-height: 14px;
    font-weight: 700;
}

.editor-code {
    counter-reset: line;
    padding: var(--space-md) var(--space-md) var(--space-md) 0;
    font-size: 12px;
    line-height: 24px;
    color: var(--on-surface-variant);
}

.code-line {
    position: relative;
    counter-increment: line;
    padding-left: calc(var(--gutter) + 1.5ch);
}

/* Numéro de ligne dans la gouttière. */
.code-line::before {
    content: counter(line);
    position: absolute;
    left: 0;
    width: var(--gutter);
    text-align: right;
    color: rgba(147, 143, 153, 0.45);
    user-select: none;
}

/* Lignes de groupe : indentées ; une ligne trop longue repart en retrait. */
.code-line.is-group {
    padding-left: calc(var(--gutter) + 1.5ch + 4ch);
    text-indent: -2ch;
}

.code-line:hover { background: rgba(255, 255, 255, 0.025); }
.code-line:hover::before { color: var(--on-surface-variant); }

.is-comment { color: var(--outline); font-style: italic; }
.tok-kw { color: var(--primary); }
.tok-var { color: var(--secondary); }
.tok-key { color: color-mix(in srgb, var(--secondary) 45%, var(--on-surface)); }
.tok-p { color: var(--outline); }
.tok-item { white-space: nowrap; }

.tok-str {
    display: inline-flex;
    align-items: baseline;
    text-indent: 0;
    white-space: nowrap;
    color: color-mix(in srgb, var(--tertiary) 55%, var(--outline));
}

.tok-str::before,
.tok-str::after {
    content: "'" / "";
    opacity: 0.7;
}

.tok-str::before { order: -1; }
.tok-str::after { order: 1; }

/* Techno utilisée dans les projets : chaîne vive, soulignée, cliquable. */
button.tok-str {
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: none;
    font: inherit;
    line-height: inherit;
    color: var(--tertiary);
    text-decoration: underline dotted color-mix(in srgb, var(--tertiary) 50%, transparent);
    text-underline-offset: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

button.tok-str:hover,
button.tok-str:focus-visible {
    background: color-mix(in srgb, var(--tertiary) 14%, transparent);
    text-decoration-color: var(--tertiary);
}

.tok-count {
    order: 2;
    position: relative;
    top: -0.55em;
    margin-left: 1px;
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
}

.editor-caret {
    display: inline-block;
    width: 7px;
    height: 15px;
    margin-left: 4px;
    vertical-align: -2px;
    background: var(--secondary);
    animation: caret-blink 1.1s steps(1, end) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

.editor-status {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 3px var(--space-md);
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    border-top: 1px solid rgba(72, 72, 72, 0.6);
    font-size: 11px;
    line-height: 18px;
    color: var(--on-surface-variant);
}

/* Les lignes s'écrivent une à une. */
.stack-editor.reveal .code-line {
    opacity: 0;
    translate: -8px 0;
    transition: opacity 0.4s, translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(0.25s + var(--i, 0) * 70ms);
}

.stack-editor.visible .code-line { opacity: 1; translate: none; }

@media (min-width: 768px) {
    .stack-editor { --gutter: 6ch; }
    .editor-code { font-size: 13px; line-height: 26px; }
}

@media (max-width: 479px) {
    .editor-status span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .stack-editor.reveal .code-line { opacity: 1; translate: none; transition: none; }
    .editor-caret { animation: none; }
}

.section-subtitle {
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 28px;
    font-weight: 500;
}

.skills-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}

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

/* Cartes nées de flaques d'huile (controllers/skillsDeck.js), comme les
   projets. Posée, chaque carte garde une légère inclinaison (--tilt) et se
   redresse quand on s'en sert. */
.skills-grid { position: relative; }

.skill-card {
    position: relative;
    z-index: 1;
    transform: rotate(var(--tilt, 0deg));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease, filter 0.5s ease;
}

.skill-card:hover,
.skill-card:focus-within,
.skill-card:has(.skill-details.open) { transform: none; }

/* Avant sa flaque, la carte est invisible. */
.skills-grid.is-fluid .skill-card:not(.is-in) {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
    filter: blur(6px);
    pointer-events: none;
}

/* Calque du liquide, un peu plus grand que la grille pour le liseré des flaques. */
.skills-fluid {
    position: absolute;
    top: -40px;
    left: -24px;
    width: calc(100% + 48px);
    height: calc(100% + 80px);
    z-index: 0;
    pointer-events: none;
}

.skill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.skill-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-level {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    line-height: 14px;
    color: var(--accent);
}

.skill-title {
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 26px;
    font-weight: 500;
}

.skill-desc { color: var(--on-surface-variant); }

.skill-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-highest);
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-bar-fill.active { transform: scaleX(var(--fill)); }

.skill-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm);
    margin-top: var(--space-xs);
    border-radius: var(--radius);
    background: var(--surface-low);
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--on-surface-variant);
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
}

.skill-toggle:hover { background: var(--surface-high); color: var(--on-surface); }
.skill-toggle .icon { transition: transform 0.25s; }
.skill-toggle.open .icon { transform: rotate(180deg); }

/* Ouverture animée sans hauteur fixe (grid 0fr → 1fr) */
.skill-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.skill-details.open { grid-template-rows: 1fr; }

.skill-details-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skill-details.open .skill-details-inner { padding-top: var(--space-xs); }

.ac-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-item {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    line-height: 18px;
    color: var(--on-surface-variant);
}

.ac-code {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent);
}

.reflexion {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border-radius: var(--radius);
    background: var(--surface-lowest);
    font-size: var(--text-xs);
    line-height: 18px;
    color: var(--on-surface-variant);
}

.reflexion strong { color: var(--on-surface); font-weight: 600; }

@media (min-width: 768px) {
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .skills-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}

/* ---------- Objectif ---------- */
.callout-section { overflow: hidden; }

/* Cadre néon (voir « Cadres néon ») : le halo du néon dépasse du cadre, c'est
   la section qui coupe ce qui déborde. */
.callout {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
}

.callout-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: center;
}

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


.callout-text p {
    max-width: 42rem;
    font-size: var(--text-base);
    line-height: 26px;
    color: var(--on-surface-variant);
}

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

@media (min-width: 640px) and (max-width: 1023px) {
    .callout-actions { flex-direction: row; }
    .callout-actions .btn { flex: 1; }
}

@media (min-width: 1024px) {
    .callout { padding: var(--space-xl); }
    .callout-grid { grid-template-columns: 2fr 1fr; }
}

/* ---------- Contact ---------- */
.contact-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    align-self: flex-start;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--surface-container);
    font-family: var(--font-label);
    font-size: var(--text-xs);
    line-height: 14px;
    color: var(--outline);
    white-space: nowrap;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    min-width: 0;
    transition: background-color 0.2s;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.contact-card:hover .contact-icon { transform: scale(1.1); }

.contact-value {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 24px;
    font-weight: 600;
    overflow-wrap: anywhere;
    transition: color 0.2s;
}

.contact-card:hover .contact-value { color: var(--accent); }

@media (min-width: 640px) {
    .contact-status { align-self: auto; }
}

@media (min-width: 768px) {
    .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

