:root {
  color-scheme: light;
  --page: #f4f6f7;
  --surface: #fff;
  --surface-soft: #edf2f2;
  --ink: #17212b;
  --muted: #627078;
  --line: #dce4e4;
  --navy: #101a2b;
  --accent: #b8ef73;
  --accent-ink: #263819;
  --teal: #147d78;
  --shadow: 0 20px 55px rgba(16, 26, 43, .09);
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #101721;
  --surface: #172230;
  --surface-soft: #202d3a;
  --ink: #edf3f3;
  --muted: #a7b5bb;
  --line: #30404b;
  --navy: #0b111a;
  --accent: #b8ef73;
  --accent-ink: #263819;
  --teal: #75c9c1;
  --shadow: 0 20px 55px rgba(0, 0, 0, .22);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 85px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
img, video { display: block; max-width: 100%; }
.wrap { width: calc(100% - 44px); max-width: 1120px; margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--page); background: color-mix(in srgb, var(--page) 91%, transparent); backdrop-filter: blur(16px); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.03em; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--navy); color: var(--accent); font-size: .85rem; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-size: .88rem; font-weight: 650; }
.nav-links a:hover, .text-link:hover { color: var(--teal); }
.theme-toggle { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.language-picker { display: inline-flex; flex: 0 0 auto; align-items: center; }
.language-picker select { min-height: 40px; max-width: 126px; padding: 6px 26px 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: .78rem; cursor: pointer; }
.library-hero { padding: 68px 0 50px; background: radial-gradient(ellipse at 86% 16%, rgba(184,239,115,.13), transparent 34%), linear-gradient(125deg, var(--navy), #14243a 75%, #1b3544); color: #f5f7f3; }
.eyebrow { margin: 0 0 14px; color: var(--teal); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.library-hero .eyebrow { color: var(--accent); }
.library-hero h1 { max-width: 820px; margin: 0 0 12px; font-size: clamp(2.4rem, 6vw, 4.3rem); line-height: 1.03; letter-spacing: -.06em; }
.library-hero p:last-child { max-width: 730px; margin: 0; color: #c8d3d5; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 21px 0; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--teal); font-weight: 700; }
.library-section { padding: 48px 0 78px; }
.section-title { margin: 0 0 9px; font-size: clamp(1.7rem, 3.5vw, 2.45rem); line-height: 1.15; letter-spacing: -.045em; }
.section-intro { max-width: 740px; margin: 0 0 25px; color: var(--muted); }
.domain-grid, .collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.domain-card, .collection-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); transition: transform .2s ease, box-shadow .2s ease; }
.domain-card:hover, .collection-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.domain-art, .collection-art { position: relative; display: grid; min-height: 145px; place-items: center; overflow: hidden; background: linear-gradient(145deg, #172b39, #28515a); color: var(--accent); font-size: 2rem; font-weight: 850; letter-spacing: -.04em; }
.domain-art::after { position: absolute; right: -25px; bottom: -90px; width: 230px; height: 230px; border: 1px solid rgba(184,239,115,.25); border-radius: 50%; box-shadow: 0 0 0 26px rgba(184,239,115,.045), 0 0 0 52px rgba(184,239,115,.035); content: ""; }
.domain-card-body, .collection-body { padding: 18px; }
.domain-card h2, .collection-card h3 { margin: 0 0 7px; font-size: 1.1rem; line-height: 1.28; letter-spacing: -.025em; }
.domain-card p, .collection-card p { margin: 0 0 13px; color: var(--muted); font-size: .84rem; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .74rem; }
.text-link { color: var(--teal); font-size: .81rem; font-weight: 800; }
.collection-card .collection-art { display: grid; height: 200px; height: clamp(160px, 55vw, 230px); min-height: 0; aspect-ratio: 1.68; background: var(--surface-soft); }
@supports (aspect-ratio: 1 / 1) { .collection-card .collection-art { height: auto; } }
.collection-art::after { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 7px; border-radius: 5px; background: rgba(16, 26, 43, .72); color: #fff; content: "Rayane Hadji · preview"; font-size: .62rem; font-weight: 700; letter-spacing: .02em; pointer-events: none; }
.collection-art img, .collection-art video { width: 100%; height: 100%; max-height: 230px; object-fit: cover; }
.collection-art img, .media-item img, .media-item video { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.video-preview-wrapper { position: relative; display: block; width: 100%; height: 100%; }
.video-preview-wrapper video { display: block; width: 100%; height: 100%; }
.video-play-icon { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: inline-flex; min-height: 44px; align-items: center; gap: 9px; padding: 6px 15px 6px 8px; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; background: rgba(11,20,29,.88); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.14); backdrop-filter: blur(8px); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 750; line-height: 1; white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
.video-play-icon[hidden] { display: none; }
.video-play-icon:hover { transform: translateY(-1px); border-color: #fff; background: rgba(11,20,29,.96); }
.video-play-icon:active { transform: translateY(0); }
.video-play-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.video-play-icon-symbol { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); }
.video-play-icon-symbol svg { display: block; width: 13px; height: 15px; fill: currentColor; }
.video-play-icon-label { display: block; }
.collection-art .type-fallback { display: grid; width: 100%; height: 100%; min-height: 145px; place-items: center; background: linear-gradient(145deg, #172b39, #28515a); color: var(--accent); font-weight: 800; }
.domain-pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.domain-pill { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.detail-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 30px; }
.how-panel { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.how-panel h2 { margin: 0 0 7px; font-size: 1rem; }
.how-panel p { margin: 0; color: var(--muted); font-size: .88rem; }
.how-panel .operating-sections { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.how-panel .operating-sections h3 { margin: 0 0 10px; font-size: .88rem; }
.how-panel .operating-sections ul { margin: 0; padding-left: 19px; }
.how-panel .operating-sections > ul { display: grid; gap: 12px; }
.how-panel .operating-sections li { padding-left: 2px; color: var(--text); font-size: .82rem; }
.how-panel .operating-sections li > p { margin-top: 4px; font-size: .82rem; line-height: 1.55; }
.how-panel .operating-sections li > ul { display: grid; gap: 8px; margin-top: 8px; }
.project-tools { margin-top: 21px; }
.project-tools h2, .specification-panel h2 { margin: 0 0 9px; font-size: .95rem; }
.project-specifications { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 0 0 28px; }
.specification-panel { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.specification-panel ul { margin: 0; padding-left: 19px; color: var(--muted); font-size: .84rem; }
.specification-panel li + li { margin-top: 5px; }
.project-content { margin-top: 18px; }
.project-comments { margin-top: 42px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.project-comments [hidden] { display: none !important; }
.project-comments h2 { margin: 0 0 12px; font-size: 1.4rem; }
.comment-status { min-height: 1.3em; margin: 0 0 12px; color: var(--muted); font-size: .82rem; }
.comment-list { display: grid; gap: 11px; margin-bottom: 20px; }
.visitor-comment { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.visitor-comment-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: .87rem; }
.visitor-comment-heading time { color: var(--muted); font-size: .75rem; }
.visitor-comment p { margin: 8px 0 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form, .admin-code-form { display: grid; gap: 12px; max-width: 700px; }
.comment-form label, .admin-code-form label { display: grid; gap: 6px; color: var(--ink); font-size: .83rem; font-weight: 700; }
.comment-form input, .comment-form textarea, .admin-code-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; }
.comment-form textarea { resize: vertical; }
.comment-privacy-note { margin: 0; color: var(--muted); font-size: .76rem; }
.comment-form button, .admin-code-form button { justify-self: start; }
.comment-form button:disabled, .admin-code-form button:disabled, .comment-delete:disabled { opacity: .6; cursor: wait; }
.comment-moderation { margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); }
.admin-code-form:not([hidden]) { margin-top: 12px; }
.admin-code-form[hidden] { display: none; }
.comment-delete { margin-top: 10px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: .75rem; }
.project-folder { margin: 11px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.project-folder > summary { display: flex; align-items: center; gap: 10px; padding: 14px 17px; cursor: pointer; color: var(--ink); font-size: .94rem; font-weight: 750; }
.project-folder > summary::marker { color: var(--teal); }
.project-folder-content { padding: 0 16px 15px; }
.project-folder .project-folder { margin: 10px 0 0 13px; border-left: 3px solid var(--teal); }
.project-folder .project-folder > summary { font-size: .87rem; }
.folder-note { margin: 8px 0 0; color: var(--muted); font-size: .81rem; }
.group-guide { margin: 8px 0 13px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.group-guide > p { margin: 0 0 11px; color: var(--muted); font-size: .86rem; }
.group-guide-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.group-guide-list h4 { margin: 0 0 5px; font-size: .82rem; }
.group-guide-list ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .81rem; }
.group-guide-list li + li { margin-top: 3px; }
.folder-code h3 { margin: 17px 0 9px; font-size: .91rem; }
.code-file { margin: 9px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.code-file > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; cursor: pointer; font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.code-language { color: var(--muted); font-size: .7rem; font-weight: 600; }
.code-file-body { border-top: 1px solid var(--line); }
.code-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 8px 11px; color: var(--muted); font-size: .72rem; }
.copy-code { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.copy-code:hover { border-color: var(--teal); }
.copy-status { min-height: 1em; }
.code-file pre { max-height: 70vh; overflow: auto; margin: 0; padding: 14px; background: #101a2b; color: #edf4f2; direction: ltr; text-align: left; font: .76rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; user-select: text; -webkit-user-select: text; }
.code-file code { font: inherit; white-space: pre; }
.media-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 36px; }
.media-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.protected-media::after { position: absolute; top: 9px; right: 9px; z-index: 2; max-width: calc(100% - 18px); padding: 4px 8px; border-radius: 5px; background: rgba(16, 26, 43, .72); color: #fff; content: attr(data-watermark); font-size: .65rem; font-weight: 700; line-height: 1.3; pointer-events: none; }
.media-view-trigger { display: block; width: 100%; padding: 0; border: 0; background: #e8eded; color: inherit; cursor: zoom-in; }
.media-view-trigger:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.media-view-trigger video { display: block; pointer-events: none; }
.media-preview-frame { position: relative; }
.media-preview-frame .video-play-icon { bottom: 12px; }
.media-item img, .media-item video { width: 100%; max-height: 330px; aspect-ratio: 1.4; object-fit: contain; background: #e8eded; }
.media-item figcaption { padding: 9px 11px; color: var(--muted); font-size: .78rem; font-weight: 650; text-align: center; overflow-wrap: anywhere; }
.media-viewer { width: 90vw; height: 84vh; max-width: 1100px; max-height: 84vh; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
@supports (height: 1dvh) { .media-viewer { height: min(84dvh, 760px); max-height: 84dvh; } }
.media-viewer[open] { display: flex; }
.media-viewer::backdrop { background: rgba(4, 9, 15, .88); }
.media-viewer-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.media-viewer-title { min-width: 0; margin: 0; overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.media-viewer-controls button { min-width: 38px; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); cursor: pointer; }
.media-viewer-zoom-value { min-width: 48px; color: var(--muted); font-size: .75rem; text-align: center; }
.media-viewer-close { font-size: 1.25rem; line-height: 1; }
.media-viewer-stage { position: relative; display: grid; min-height: 0; flex: 1 1 auto; overflow: auto; place-items: center; background: #080d14; }
.media-viewer-stage::after { position: fixed; top: 76px; right: max(3vw, 24px); padding: 5px 8px; border-radius: 5px; background: rgba(16, 26, 43, .68); color: #fff; content: attr(data-watermark); font-size: .68rem; font-weight: 700; pointer-events: none; }
.media-viewer-media { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: center; }
.search-row { display: flex; gap: 10px; align-items: center; margin: 0 0 18px; }
.search-row input { width: 100%; max-width: 430px; min-height: 43px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.contact-strip { margin-top: 56px; padding: 27px; border-radius: 17px; background: var(--navy); color: #f5f7f3; }
.contact-strip h2 { margin: 0 0 4px; font-size: 1.25rem; }
.contact-strip p { margin: 0; color: #c8d3d5; font-size: .87rem; }
.site-footer { padding: 23px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; }
.site-footer-inner { display: flex; justify-content: space-between; gap: 18px; }
[dir="rtl"] .project-folder .project-folder { margin-right: 13px; margin-left: 0; border-right: 3px solid var(--teal); border-left: 0; }
@media (max-width: 840px) { .domain-grid, .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .media-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .wrap { width: calc(100% - 30px); max-width: 520px; }
  .nav { min-height: 64px; flex-wrap: wrap; gap: 8px; padding-block: 9px; }
  .brand { margin-right: auto; }
  .nav-links { order: 3; width: 100%; gap: 18px; overflow-x: auto; padding: 3px 0 5px; }
  .nav-links a { flex: 0 0 auto; font-size: .8rem; }
  .language-picker { order: 2; }
  .language-picker select { max-width: 106px; }
  .library-hero { padding: 49px 0 37px; }
  .library-section { padding: 35px 0 56px; }
  .domain-grid, .collection-grid, .media-gallery, .project-specifications { grid-template-columns: 1fr; }
  .detail-intro { grid-template-columns: 1fr; gap: 15px; }
  .site-footer-inner { flex-direction: column; gap: 4px; }
  .media-viewer { width: 100%; height: 100vh; max-width: none; max-height: 100vh; border: 0; border-radius: 0; }
  @supports (height: 1dvh) { .media-viewer { height: 100dvh; max-height: 100dvh; } }
  .media-viewer-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .media-viewer-controls { justify-content: space-between; }
  .media-viewer-stage::after { top: 122px; right: 12px; }
  .video-play-icon { left: 9px; bottom: 9px; min-height: 44px; padding-right: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
