/* ============================================================
   RÓNÁN MAC CON IOMAIRE — Editorial design system
   Cream / Ink / Orange · Fraunces + Space Grotesk
   ============================================================ */

:root {
    --ink: #1b1611;
    --cream: #f2ecdf;
    --cream-2: #eae2d0;
    --orange: #e8501e;
    --line: rgba(27, 22, 17, 0.16);
    --line-soft: rgba(27, 22, 17, 0.09);
    --font-display: 'Archivo', Helvetica, sans-serif;
    --font-ui: 'Space Grotesk', -apple-system, sans-serif;
    --max-width: 1400px;
    --pad: clamp(1.25rem, 4vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--cream);
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Language toggle ---------- */
.lang-en { display: none; }
body.english .lang-ga { display: none; }
body.english .lang-en { display: block; }
body.english span.lang-ga { display: none; }
body.english span.lang-en { display: inline; }
span.lang-en { display: none; }

/* ---------- Micro-label ---------- */
.micro {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink);
}

.micro .dot { color: var(--orange); }

.micro.orange { color: var(--orange); }

/* ---------- Header ---------- */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

header.scrolled {
    background: rgba(242, 236, 223, 0.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--line);
}

.header-inner {
    max-width: 100%;
    padding: 1.1rem var(--pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    font-stretch: 110%;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.logo sup {
    font-family: var(--font-ui);
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: var(--orange);
    margin-left: 0.4rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

nav a {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}

nav a:hover, nav a.active { color: var(--orange); }

.header-meta {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
}

.header-meta .time { color: var(--orange); }

.lang-switch {
    display: flex;
    gap: 0.15rem;
    align-items: center;
    margin-left: 0.5rem;
}

.lang-switch button {
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--ink);
    opacity: 0.45;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    transition: opacity 0.2s, color 0.2s;
}

.lang-switch button.active {
    opacity: 1;
    color: var(--orange);
}

.lang-switch .sep { opacity: 0.3; font-size: 0.72rem; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    margin: 5px 0;
    transition: 0.3s;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100svh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7rem var(--pad) 4.5rem;
}

#heroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-eyebrow { margin-bottom: 2rem; }

.hero-name-1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: 82%;
    font-size: clamp(4.5rem, 16.5vw, 14.5rem);
    line-height: 0.9;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.hero-name-2-row {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 3rem;
    margin-top: clamp(0.5rem, 2vw, 1.5rem);
}

.hero-tagline {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 200px;
    text-align: left;
    padding-top: clamp(1rem, 4vw, 3.5rem);
}

.hero-name-2 {
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 750;
    font-stretch: 86%;
    font-size: clamp(2.6rem, 8.5vw, 7.5rem);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--orange);
    text-align: right;
    white-space: nowrap;
}

.hero-bottom {
    position: absolute;
    left: var(--pad);
    right: var(--pad);
    bottom: 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    z-index: 1;
}

/* ---------- Marquee ---------- */
.marquee {
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    overflow: hidden;
    padding: 1.4rem 0;
    background: var(--cream);
}

.marquee-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marquee 28s linear infinite;
}

.marquee-item {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    font-weight: 700;
    font-stretch: 92%;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.marquee-item .star {
    color: var(--orange);
    font-size: 0.6em;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
section { padding: clamp(5rem, 10vw, 9rem) var(--pad); }

.section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-label { margin-bottom: 2.5rem; }

.section-heading {
    font-family: var(--font-display);
    font-weight: 750;
    font-stretch: 90%;
    font-size: clamp(2.6rem, 6.5vw, 5.5rem);
    line-height: 1.0;
    letter-spacing: -0.025em;
    margin-bottom: clamp(3rem, 6vw, 5rem);
    max-width: 18ch;
}

.section-heading em {
    font-style: italic;
    color: var(--orange);
}

/* ---------- Moladh (quotes) ---------- */
.lead-quote {
    font-family: var(--font-display);
    font-weight: 450;
    font-size: clamp(1.5rem, 3.4vw, 2.6rem);
    line-height: 1.3;
    max-width: 28ch;
    margin-bottom: 1.5rem;
}

.lead-quote em { font-style: italic; color: var(--orange); }

.quote-cite {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.quote-cite strong { color: var(--orange); font-weight: 600; }

.quote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: clamp(3rem, 6vw, 5rem);
    border-top: 1px solid var(--ink);
}

.quote-cell {
    padding: 2.2rem 2.5rem 2.2rem 0;
    border-bottom: 1px solid var(--line);
}

.quote-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.quote-cell:nth-child(even) { padding-left: 2.5rem; padding-right: 0; }

.quote-cell p {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.45;
    margin-bottom: 1.2rem;
}

.moladh-photo {
    margin-top: clamp(3rem, 6vw, 5rem);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    align-items: end;
}

.moladh-photo img {
    width: 100%;
    filter: grayscale(20%);
}

.moladh-photo figcaption { padding-bottom: 0.5rem; }

/* ---------- Leabhair (books) ---------- */
#leabhair { background: var(--cream-2); }

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
}

.book {
    text-decoration: none;
    color: inherit;
}

.book-cover {
    background: var(--cream);
    border: 1px solid var(--line);
    aspect-ratio: 2/3;
    overflow: hidden;
    margin-bottom: 1.4rem;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.book:hover .book-cover img { transform: scale(1.04); }

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
}

.book-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    color: var(--orange);
    line-height: 1.1;
}

.book p {
    font-size: 0.85rem;
    line-height: 1.55;
    max-width: 34ch;
}

/* ---------- Scannáin (documentaries) ---------- */
.films-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
}

.film {
    cursor: pointer;
}

.film-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--ink);
    margin-bottom: 1.3rem;
}

.film-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
}

.film:hover .film-thumb img {
    transform: scale(1.04);
    opacity: 0.85;
}

.film-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s;
}

.film-play::after {
    content: '';
    width: 0; height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid var(--orange);
    margin-left: 3px;
}

.film:hover .film-play { transform: translate(-50%, -50%) scale(1.12); }

.film-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.film-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    color: var(--orange);
    line-height: 1.1;
}

.film p {
    font-size: 0.85rem;
    line-height: 1.55;
    max-width: 44ch;
}

/* ---------- Scríbhneoireacht (writing rows) ---------- */
#scribhneoireacht { background: var(--cream-2); }

.writing-rows { border-top: 1px solid var(--ink); }

.writing-row {
    display: grid;
    grid-template-columns: 4rem 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 2.4rem 1rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    transition: background 0.35s ease, color 0.35s ease;
    position: relative;
}

a.writing-row:hover {
    background: var(--ink);
    color: var(--cream);
}

a.writing-row:hover .writing-row-title { color: var(--cream); }
a.writing-row:hover .row-num { color: var(--orange); }
a.writing-row:hover .row-arrow { color: var(--orange); transform: translateX(6px); }

.row-num {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--orange);
}

.writing-row-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: 92%;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    line-height: 1.05;
    transition: color 0.35s ease;
}

.row-arrow {
    font-size: 1.4rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.writing-row.disabled { opacity: 0.45; cursor: default; }

/* ---------- Teagmháil (contact, dark) ---------- */
#teagmhail {
    background: var(--ink);
    color: var(--cream);
}

#teagmhail .micro { color: var(--cream); }
#teagmhail .micro .dot { color: var(--orange); }

#teagmhail .section-heading { color: var(--cream); }

.contact-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
}

.contact-bio {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    line-height: 1.45;
    font-weight: 400;
}

.contact-bio em { font-style: italic; color: var(--orange); }

.contact-bio p + p { margin-top: 1.5rem; }

.contact-email {
    display: inline-block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: var(--orange);
    text-decoration: none;
    margin: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--orange);
    padding-bottom: 0.3rem;
    transition: opacity 0.25s;
}

.contact-email:hover { opacity: 0.75; }

.socials {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
}

.socials a {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream);
    text-decoration: none;
    transition: color 0.2s;
}

.socials a:hover { color: var(--orange); }

.footer-line {
    margin-top: clamp(4rem, 8vw, 6rem);
    padding-top: 1.4rem;
    border-top: 1px solid rgba(242, 236, 223, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(242, 236, 223, 0.65);
}

.footer-line a { color: inherit; text-decoration: none; }
.footer-line a:hover { color: var(--orange); }

/* ---------- Inner pages ---------- */
.page-header {
    padding: 9rem var(--pad) 4rem;
    position: relative;
    overflow: hidden;
}

.page-header .section-inner { position: relative; z-index: 1; }

.page-title {
    font-family: var(--font-display);
    font-weight: 750;
    font-stretch: 90%;
    font-size: clamp(2.8rem, 8vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.015em;
    margin: 1.5rem 0 1.2rem;
}

.page-title em { font-style: italic; color: var(--orange); }

.page-header p { max-width: 50ch; font-size: 0.9rem; }

.back-link {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--orange);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.back-link:hover { text-decoration: underline; }

/* Writing list (accordion) */
.writing-list {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem var(--pad) 6rem;
}

.writing-item { border-bottom: 1px solid var(--line); }
.writing-item:first-child { border-top: 1px solid var(--ink); }

.writing-item-header {
    padding: 1.8rem 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: padding-left 0.25s ease;
}

.writing-item-header:hover { padding-left: 1.2rem; }

.writing-item-header h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.3rem, 2.6vw, 1.9rem);
    line-height: 1.15;
}

.writing-item-header .year {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--orange);
    margin-left: 0.8rem;
}

.toggle-icon {
    font-family: var(--font-ui);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--orange);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.writing-item.open .toggle-icon { transform: rotate(45deg); }

.writing-item-content { display: none; padding: 0.5rem 0.5rem 2.5rem; }
.writing-item.open .writing-item-content { display: block; }

.writing-item-content .video-embed { margin-bottom: 2rem; }

.writing-item-content .video-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

.writing-text {
    white-space: pre-line;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.75;
}

.writing-text strong { color: var(--orange); font-weight: 600; }
.writing-text em { font-style: italic; }

/* ---------- Video modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 22, 17, 0.94);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active { display: flex; }

.modal-content {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16/9;
    position: relative;
}

.modal-content iframe { width: 100%; height: 100%; border: none; }

.modal-close {
    position: absolute;
    top: -52px;
    right: 0;
    background: none;
    border: none;
    color: var(--cream);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Custom cursor ---------- */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--cream);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1500;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.25s ease;
}

.cursor-dot.on { transform: translate(-50%, -50%) scale(1); }

@media (pointer: coarse) { .cursor-dot { display: none; } }

/* ---------- Reveal helper ---------- */
[data-reveal] { will-change: transform; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .quote-grid { grid-template-columns: 1fr; }
    .quote-cell:nth-child(odd) { border-right: none; }
    .quote-cell:nth-child(even) { padding-left: 0; padding-right: 2.5rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .films-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .books-grid { grid-template-columns: 1fr; max-width: 420px; }
    .moladh-photo { grid-template-columns: 1fr; }
    .writing-row { grid-template-columns: 3rem 1fr auto; }
    .hero-name-2 { white-space: normal; }
    .hero-years { display: none; }
}

@media (max-width: 768px) {
    .header-meta { display: none; }

    nav {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--cream);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1050;
    }

    nav.active { display: flex; }

    nav a { font-size: 1rem; }

    .menu-toggle { display: block; position: relative; z-index: 1100; }

    .hero { padding-top: 6rem; }

    .hero-name-2-row { flex-direction: column-reverse; gap: 1.5rem; }
    .hero-tagline { padding-top: 0; max-width: 100%; }
    .hero-name-2 { text-align: left; }

    .hero-bottom { flex-wrap: wrap; gap: 0.6rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cursor-dot { display: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}


/* ---------- Book sub-pages ---------- */
.book-page { padding: 8.5rem var(--pad) 5rem; }

.book-page-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
}

.book-page-cover {
    position: sticky;
    top: 7rem;
    border: 1px solid var(--line);
    background: var(--cream-2);
}

.book-page .page-title {
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    margin: 1rem 0 0.8rem;
}

.pub-line { margin-bottom: 1.8rem; }

.award-chip {
    display: inline-block;
    border: 1px solid var(--orange);
    color: var(--orange);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.55rem 0.9rem;
    margin-bottom: 1.8rem;
}

.book-body {
    font-size: 0.95rem;
    line-height: 1.75;
    max-width: 62ch;
}

.book-body p + p { margin-top: 1.1rem; }
.book-body strong { font-weight: 600; }

.book-quote {
    border-left: 2px solid var(--orange);
    padding-left: 1.5rem;
    margin: 2.2rem 0;
    max-width: 58ch;
}

.book-quote p:first-child {
    font-family: var(--font-display);
    font-size: 1.08rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn-buy, .btn-ghost {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1rem 1.7rem;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.btn-buy {
    background: var(--orange);
    color: var(--cream);
}

.btn-buy:hover { background: var(--ink); }

.btn-ghost {
    border: 1px solid var(--ink);
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--cream);
}

@media (max-width: 900px) {
    .book-page-grid { grid-template-columns: 1fr; }
    .book-page-cover { position: static; max-width: 300px; }
}



/* ---------- Tide divider ---------- */
.tide-divider {
    padding: clamp(1rem, 2.5vw, 2rem) 0;
    background: var(--cream);
}

#tideCanvas {
    display: block;
    width: 100%;
    height: clamp(85px, 10vw, 120px);
}

/* ---------- Ailt page ---------- */
.ailt-list { max-width: 1100px; }

.ailt-list .section-label { margin: 0 0 1.2rem; }

.ailt-group-2 { margin-top: 4rem !important; }

.ailt-row .writing-row-title {
    font-size: clamp(1.15rem, 2.1vw, 1.65rem);
    line-height: 1.2;
}

.ailt-row .row-meta {
    display: inline-block;
    margin-top: 0.5rem;
}

a.ailt-row:hover .row-meta { color: var(--orange); }

.contact-bio .bio-awards {
    font-family: var(--font-ui);
    font-size: 0.97rem;
    line-height: 1.7;
    opacity: 0.92;
    margin-top: 1.8rem !important;
}
