/* ====================================================================
   AL HUT الحوت — SHARED STYLE SYSTEM
   "Night Broadcast": brutalist paper-cutout panels on a quiet dark wall.
   Palette sampled from the site's own images (background gifs, portrait,
   logo) instead of stock neon — indigo night, sage screen-green, amber
   glow, dusty rose, muted teal, signature logo red.
   Accent per page is set via <body data-accent="yellow|green|pink|magenta|cyan">
   ==================================================================== */

:root {
    --ink: #0b0b0c;
    --paper: #f2ede1;
    --paper-dim: #e7e0cf;
    --line: #0b0b0c;
    --ink-soft: #cfccc2;

    --yellow: #e0a53a;   /* amber glow, from background_music/contact */
    --red: #d94a3a;      /* logo red, muted */
    --green: #7c9873;    /* sage screen-green, from background_spaces/contact */
    --pink: #b5615a;     /* dusty rose/terracotta */
    --magenta: #4a4a8f;  /* indigo/violet night, from background_spaces */
    --cyan: #4f9a94;     /* muted teal */

    /* default accent, overridden per-page via [data-accent] below */
    --accent: var(--yellow);
}

body[data-accent="yellow"]   { --accent: var(--yellow); }
body[data-accent="green"]    { --accent: var(--green); }
body[data-accent="pink"]     { --accent: var(--pink); }
body[data-accent="magenta"]  { --accent: var(--magenta); }
body[data-accent="cyan"]     { --accent: var(--cyan); }

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px;
    background-color: var(--ink);
    color: var(--paper);
    font-family: 'Courier Prime', 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: none;
}

/* Static film-grain — quiet texture, not animated glitch */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
    mix-blend-mode: overlay;
    opacity: 0.4;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/></svg>");
}

/* ---- Page background gif (each page picks its own via <img class="bg-gif">) ---- */
.bg-gif {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.32;
    image-rendering: pixelated;
    pointer-events: none;
    user-select: none;
}

/* ---- Custom cursor ---- */
#custom-cursor {
    position: fixed;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
/* Touch devices never fire mousemove, so the cursor image would otherwise
   just sit stranded in the corner — hide it and bring back a real cursor */
@media (hover: none), (pointer: coarse) {
    #custom-cursor { display: none; }
    body, .nav-btn, .link-btn, .action-btn, .submit-btn, .social-link,
    .launch-btn, .download-btn, input, textarea { cursor: auto; }
}

.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

a { color: inherit; }

/* ---- Ticker (home only) ---- */
.hazard-stripe {
    border: 3px solid var(--line);
    background: var(--yellow);
    color: #0b0b0c;
    box-shadow: 6px 6px 0 var(--line), 0 0 22px rgba(255, 204, 0, 0.25);
    overflow: hidden;
    white-space: nowrap;
    padding: 9px 0;
    font-family: 'VT323', monospace;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-sizing: border-box;
}
#ticker-text {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 22s linear infinite;
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ---- Header panels ---- */
header, .about-card, .featured-project, .section-block {
    background: var(--paper);
    color: var(--ink);
    border: 4px solid var(--line);
    box-shadow: 10px 10px 0 var(--line);
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 34px 24px 28px;
    width: 100%;
}
header.header-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    text-align: left;
    padding: 22px 24px;
}
header.header-row .head-text { display: flex; flex-direction: column; gap: 6px; }

.main-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

h1 {
    margin: 0;
    font-family: 'VT323', monospace;
    font-size: clamp(1.9rem, 6vw + 1rem, 3rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 var(--accent);
    text-wrap: balance;
}
.header-subtitle {
    margin: 0;
    font-size: 1.05em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-top: 2px dashed var(--ink);
    border-bottom: 2px dashed var(--ink);
    padding: 10px 0;
    width: 100%;
    max-width: 480px;
}
header.header-row p { text-wrap: balance; }
header p { margin: 0; font-weight: bold; }

/* ---- Nav rack (icon buttons, every page) ---- */
.nav-rack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}
.nav-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 78px;
    padding: 8px 4px 7px;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    background: var(--ink);
    border: 2px solid var(--paper-dim);
    color: var(--paper-dim);
    box-shadow: 3px 3px 0 var(--line);
    transition: transform 0.08s ease, border-color 0.15s ease, color 0.15s ease;
}
.nav-icon-btn:hover { transform: translate(2px, 2px); border-color: var(--paper); color: var(--paper); }
.nav-icon-btn img {
    width: 34px;
    height: 34px;
    image-rendering: pixelated;
}
.nav-icon-btn svg { width: 34px; height: 34px; }
/* Same neutral chrome for every item — only the current page stands out */
.nav-icon-btn.current { background: var(--paper); color: var(--ink); border-color: var(--ink); }

/* ---- Buttons: back / link / action / submit (brutalist press effect) ---- */
.nav-btn, .link-btn, .action-btn, .submit-btn, .social-link, .cv-link.button, .launch-btn, .download-btn {
    display: inline-block;
    border: 2px solid var(--ink);
    padding: 10px 16px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    font-weight: bold;
    background: #ffffff;
    box-shadow: 4px 4px 0 var(--ink);
    transition: 0.1s;
    cursor: none;
}
.nav-btn:hover, .link-btn:hover, .social-link:hover, .download-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--ink);
    background-color: var(--accent);
}
.action-btn, .launch-btn {
    border: 3px solid #000;
    color: #fff;
    background-color: var(--red);
    box-shadow: 4px 4px 0 #000;
}
.action-btn:hover, .launch-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
    background-color: #000;
    color: #fff;
}
.submit-btn {
    background: var(--yellow);
    cursor: none;
    font-size: 1.2em;
    border: 3px solid #000;
}
.submit-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

.eyebrow-tag {
    display: inline-block;
    align-self: flex-start;
    background: var(--ink);
    color: var(--paper);
    font-family: 'VT323', monospace;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 10px;
}
.event-flyer {
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 2px solid #000;
    display: block;
}

/* ---- Featured project / tool panel (home) ---- */
.featured-project {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    padding: 0;
}
.fp-image-container {
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    border-bottom: 4px solid var(--line);
    background: #fff;
}
.noisexp-logo { width: 100%; max-width: 240px; height: auto; }
.fp-content { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.fp-content p { margin: 0; line-height: 1.6; font-weight: bold; }

/* ---- Section blocks (content pages) ---- */
.section-block {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}
h2 {
    font-family: 'VT323', monospace;
    font-size: 1.7em;
    margin: 0 0 4px 0;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.section-block p { line-height: 1.5; }

/* ---- Embeds / grids / cards ---- */
.embed-wrapper { width: 100%; overflow: hidden; border: 2px solid #000; background: #000; }
.embed-wrapper iframe { width: 100%; height: 100%; border: 0; }

.video-grid, .tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}
.video-item, .tool-card, .lab-card {
    border: 2px solid #000;
    background: #fff;
    padding: 15px;
    box-shadow: 4px 4px 0 #000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.video-item h3, .tool-card h3, .lab-card h4 {
    margin: 0;
    font-family: 'VT323', monospace;
    font-size: 1.25em;
    text-transform: uppercase;
    background-color: var(--accent);
    display: inline-block;
    padding: 4px 10px;
    border: 2px solid #000;
    align-self: flex-start;
}
.tool-card p, .lab-card p { margin: 0; font-weight: bold; line-height: 1.5; font-size: 0.95em; flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tag {
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    border: 1px solid #000;
    padding: 1px 8px;
    background: var(--paper-dim);
}
.tool-versions { font-size: 0.78em; font-weight: bold; }
.tool-versions a { border-bottom: 1px dotted #000; margin: 0 3px; }

.project-card { border-left: 4px solid #000; padding-left: 15px; }
.project-card h3 {
    margin: 0 0 15px 0;
    font-family: 'VT323', monospace;
    font-size: 1.4em;
    text-transform: uppercase;
    background-color: var(--accent);
    display: inline-block;
    padding: 4px 10px;
    border: 2px solid #000;
}
.project-card p { margin: 0 0 15px 0; font-weight: bold; line-height: 1.4; }
.project-img { width: 100%; max-width: 450px; height: auto; border: 2px solid #000; display: block; margin-bottom: 15px; background: #ddd; }

.installation-item { border-left: 4px solid #000; padding-left: 15px; }
.installation-item h3 { font-family: 'VT323', monospace; font-size: 1.3em; text-transform: uppercase; margin: 0 0 8px 0; }
.year-tag { background: #000; color: #fff; padding: 2px 6px; font-size: 0.7em; margin-right: 8px; font-family: 'Courier Prime', monospace; }

.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.social-link {
    display: flex; align-items: center; justify-content: center;
    padding: 15px; font-size: 1.05em; box-shadow: 5px 5px 0 #000; text-align: center;
}

/* ---- Forms ---- */
form { display: flex; flex-direction: column; gap: 15px; }
input, textarea {
    width: 100%;
    padding: 14px;
    border: 3px solid #000;
    background: #fff;
    color: #000;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    box-sizing: border-box;
    box-shadow: 4px 4px 0 #000;
    cursor: none;
}
input:focus, textarea:focus { outline: none; background: #fffde6; border-color: var(--accent); }

/* ---- About page portrait mask ---- */
.about-card { width: 100%; padding: 30px; text-align: left; }
.img-container { position: relative; width: 100%; margin-bottom: 25px; border: 3px solid #000; background: var(--paper); overflow: hidden; }
#portrait { width: 100%; display: block; }
#maskCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.about-card h1 { font-size: 2.2em; text-align: left; text-shadow: none; margin-bottom: 4px; }
.about-card ul { list-style: none; padding: 0; margin: 0; }
.about-card li { margin-bottom: 12px; line-height: 1.4; font-size: 0.95em; font-weight: bold; }
.cv-link { color: #000; text-decoration: underline; text-underline-offset: 3px; }
.cv-link:hover { background-color: var(--accent); }

/* ---- Lab / downloads section ---- */
.lab-section-note { font-size: 0.95rem; max-width: 700px; color: #4a4636; }
.download-btn { background: var(--paper-dim); }

footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-soft);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: 6px;
}

@media (max-width: 768px) {
    body { padding: 14px; }
    header.header-row { flex-direction: column; align-items: center; text-align: center; gap: 15px; }
    .nav-icon-btn { width: 68px; font-size: 0.82rem; }
    .section-block, .fp-content, .about-card { padding: 18px; }
    header { padding: 24px 16px 20px; }
    .header-subtitle { letter-spacing: 1px; font-size: 0.95em; }
}

@media (max-width: 420px) {
    body { padding: 10px; }
    .nav-rack { gap: 6px; }
    .nav-icon-btn { width: 58px; padding: 6px 3px 5px; font-size: 0.72rem; }
    .nav-icon-btn img, .nav-icon-btn svg { width: 26px; height: 26px; }
    .section-block, .fp-content, .about-card { padding: 14px; }
    .hazard-stripe { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    #ticker-text { animation: none; }
}
