/* ==========================================================================
   International Conference 2027 — shared styles
   Used by every page: tokens, type, topbar, footer, buttons, glass, and the
   abstract submission and admin pages. Home-page sections live in home.css.

   Palette sampled from documents/background 01.jpg and checked against the
   save-the-date artwork. Orange never carries white text (2.6:1); orange
   buttons carry deep purple instead.
   ========================================================================== */

:root {
    --primary: #A54DC2;        /* buttons, badges; white text 4.7:1 */
    --primary-deep: #492165;   /* utility strip, chrome; white text 12.4:1 */
    --primary-ink: #8A35A8;    /* purple text on white or cream */
    --secondary: #FF7B00;      /* fills; deep-purple text on it 4.8:1 */
    --secondary-ink: #B5560A;  /* orange text on white 4.9:1 */
    --gold: #FEA400;           /* highlights on dark surfaces */

    --night: #22103A;          /* hero, page heads, footer */
    --cream: #FEF1DD;
    --lavender: #F5F0F9;
    --paper: #FFFFFF;
    --ink: #2A1438;
    --muted: #6B5876;
    --rule: #EBDDEF;
    --zebra: #FAF6FC;
    --on-dark: rgba(255, 255, 255, .80);

    --glass-light: rgba(255, 255, 255, .58);
    --glass-dark: rgba(255, 255, 255, .09);
    --blur: blur(22px) saturate(170%);

    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: Barlow, "Helvetica Neue", Arial, sans-serif;

    --shell: 40px;
    --inner: 1200px;
    --radius: 22px;
}

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

body {
    margin: 0;
    background: var(--lavender);
    color: var(--ink);
    font: 400 16px/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; }
p, ul, ol { margin: 0; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.shell { padding-inline: var(--shell); }
.inner { width: 100%; max-width: var(--inner); margin-inline: auto; }
.section { padding-block: 64px; }

.eyebrow {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.h-xl { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -.025em; }
.h-md { font-size: 1.44rem; font-weight: 700; letter-spacing: -.01em; }
.lede { max-width: 66ch; }

/* --------------------------------------------------------- utility bar --- */

.utility {
    background: var(--primary-deep);
    color: var(--on-dark);
    font-size: .8125rem;
}

.utility .inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 24px;
    min-height: 38px;
    padding-block: 6px;
}

.utility strong { color: var(--gold); font-weight: 600; }
.utility nav { display: flex; gap: 20px; }
.utility nav a { color: #fff; font-weight: 600; text-decoration: none; }
.utility nav a:hover { color: var(--gold); }

/* Log Out, once logged in: a form button that reads as one of the links */
.utility .inline-form { display: inline; margin: 0; }

.utility .link-button {
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

.utility .link-button:hover { color: var(--gold); }

/* -------------------------------------------------------------- header --- */

.site-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 30;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

.brand img { height: 52px; width: auto; }

/* Menu button for small screens: a purple pill whose three bars fold into a cross */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 18px 0 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--primary-ink));
    color: #fff;
    font: 700 .95rem var(--font-body);
    letter-spacing: .02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 22px -12px rgba(138, 53, 168, .9);
    cursor: pointer;
    transition: background-color .2s, transform .2s;
}

.nav-toggle:active { transform: scale(.97); }
.site-header.open .nav-toggle { background: var(--primary-deep); }

.burger { position: relative; width: 18px; height: 12px; }

.burger i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: top .25s, transform .25s, opacity .2s;
}

.burger i:nth-child(1) { top: 0; }
.burger i:nth-child(2) { top: 5px; }
.burger i:nth-child(3) { top: 10px; width: 70%; }

.site-header.open .burger i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.site-header.open .burger i:nth-child(2) { opacity: 0; }
.site-header.open .burger i:nth-child(3) { top: 5px; width: 100%; transform: rotate(-45deg); }

.nav-toggle-label { min-width: 3.1em; text-align: left; }

/* account links appear inside the menu only when it is collapsed */
.nav .menu-account { display: none; }

.nav { display: flex; align-items: center; gap: 2px; list-style: none; padding: 0; margin: 0; }

.menu { position: relative; }

.menu > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 26px 9px;
    color: var(--primary-deep);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.menu > a svg { width: 12px; height: 12px; opacity: .6; transition: transform .2s; }
.menu:hover > a, .menu:focus-within > a, .menu > a[aria-current] { color: var(--primary-ink); }
.menu:hover > a svg, .menu:focus-within > a svg { transform: rotate(180deg); }

/* the orange underline marks the open menu, and the section you are in */
.menu > a::after {
    content: "";
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 0;
    height: 3px;
    background: var(--secondary);
    transform: scaleX(0);
    transition: transform .2s;
}

.menu:hover > a::after,
.menu:focus-within > a::after,
.menu > a[aria-current]::after { transform: scaleX(1); }

.sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    margin: 0;
    padding: 8px 0;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-top: 0;
    box-shadow: 0 14px 30px -12px rgba(73, 33, 101, .35);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s, transform .18s, visibility .18s;
}

.menu:hover .sub, .menu:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.menu.align-right .sub { left: auto; right: 0; }

.sub a {
    display: block;
    padding: 8px 18px;
    color: var(--ink);
    font-size: .9rem;
    text-decoration: none;
}

.sub a:hover, .sub a:focus-visible { background: var(--cream); color: var(--primary-ink); }

/* -------------------------------------------------------------- glass --- */

/* A frosted pane with a brighter top-left rim, the way light catches a lens.
   Put it over colour, or the blur has nothing to show. */
.glass, .glass-dark { position: relative; isolation: isolate; }

.glass {
    background: var(--glass-light);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .9),
        0 24px 48px -28px rgba(73, 33, 101, .45),
        0 2px 6px -2px rgba(73, 33, 101, .12);
}

.glass-dark {
    background: var(--glass-dark);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .28),
        0 24px 48px -24px rgba(10, 0, 25, .55);
}

.glass::before, .glass-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(140deg,
        rgba(255, 255, 255, .95), rgba(255, 255, 255, .18) 38%,
        rgba(255, 255, 255, .06) 62%, rgba(255, 255, 255, .55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.glass-dark::before {
    background: linear-gradient(140deg,
        rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 40%,
        rgba(255, 255, 255, .03) 65%, rgba(255, 255, 255, .30));
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass { background: rgba(255, 255, 255, .92); }
    .glass-dark { background: rgba(48, 22, 74, .88); }
}

/* ------------------------------------------------------------ buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    border: 2px solid transparent;
    border-radius: 999px;
    font: 700 .95rem/1 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s, background-color .2s, border-color .2s, color .2s;
}

.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn-block { width: 100%; }

.btn-gold {
    background: linear-gradient(180deg, #FFBE3D, var(--gold));
    color: var(--primary-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 24px -10px rgba(254, 164, 0, .7);
}

.btn-glass { color: #fff; }
.btn-glass:hover { background: rgba(255, 255, 255, .16); }

.btn-purple,
.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-ink));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 24px -12px rgba(138, 53, 168, .8);
}

.btn-ghost { background: var(--paper); border-color: var(--rule); color: var(--primary-ink); }
.btn-ghost:hover { border-color: var(--primary); }

/* ------------------------------------------------------------- footer --- */

.site-footer { background: var(--night); color: var(--on-dark); font-size: .9rem; }

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr);
    gap: 48px;
    padding-block: 64px 40px;
}

.footer-brand img { width: 250px; height: auto; }
.footer-brand p { margin-top: 18px; max-width: 34ch; }
.footer-brand a { color: #fff; }

.sitemap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 24px; }

.sitemap h3 {
    margin-bottom: 10px;
    color: var(--gold);
    font: 700 .95rem/1.2 var(--font-display);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sitemap ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.sitemap a { color: var(--on-dark); text-decoration: none; }
.sitemap a:hover { color: #fff; text-decoration: underline; }

.footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-block: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .8125rem;
}

/* ==========================================================================
   Inner pages: abstract submission and admin
   ========================================================================== */

.page-head {
    padding-block: 56px 48px;
    color: #fff;
    background:
        radial-gradient(50% 120% at 90% 0%, rgba(165, 77, 194, .45), transparent 70%),
        radial-gradient(40% 90% at 100% 100%, rgba(255, 123, 0, .22), transparent 70%),
        linear-gradient(160deg, var(--night), #3A1A5E);
}

.page-head .eyebrow { color: var(--gold); margin-bottom: 10px; }
.page-head .h-xl { color: #fff; }
.page-head .lede { margin-top: 12px; color: var(--on-dark); }

.form-section { background: var(--lavender); }
.form { max-width: 860px; }
.field { margin-bottom: 20px; }

.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row .field { flex: 1 1 220px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .2px;
}

.req { color: var(--secondary-ink); }

.field input,
.field select {
    width: 100%;
    padding: 11px 14px;
    background: var(--paper);
    border: 2px solid var(--rule);
    border-radius: 10px;
    color: var(--ink);
    font: inherit;
}

.field input:focus,
.field select:focus { outline: none; border-color: var(--primary); }

.hint { margin-top: 6px; font-size: .8125rem; color: var(--muted); }
.counter { font-weight: 600; color: var(--ink); }
.counter .over, #word-count.over { color: var(--secondary-ink); font-weight: 700; }

.symbol-palette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: var(--paper);
    border: 2px solid var(--rule);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.palette-label {
    margin-right: 4px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted);
}

.sym {
    min-width: 30px;
    height: 30px;
    background: var(--lavender);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--primary-ink);
    font: 600 15px/1 var(--font-body);
    cursor: pointer;
}

.sym:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* SunEditor sits directly under the palette */
.sun-editor { border-radius: 0 0 10px 10px !important; border-color: var(--rule) !important; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.alert {
    padding: 16px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: var(--paper);
    font-size: .9375rem;
}

.alert-error { border-left-color: var(--secondary); }
.alert-ok { border-left-color: #1F9D55; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }

.preview {
    max-width: 780px;
    padding: 24px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.preview .h-md { color: var(--primary-ink); margin-bottom: 8px; }
.preview-authors { font-size: .9375rem; font-weight: 600; }
.preview-affiliation { font-size: .9375rem; font-style: italic; }
.preview-tags { margin: 6px 0 16px; font-size: .8125rem; color: var(--muted); }
.preview-body p + p { margin-top: .75rem; }

.table-wrap { overflow-x: auto; margin-top: 24px; border-radius: 12px; }

.register { width: 100%; border-collapse: collapse; font-size: .875rem; background: var(--paper); }

.register th {
    padding: 10px 12px;
    background: var(--primary-deep);
    color: #fff;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.register td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.register tr:nth-child(even) td { background: var(--zebra); }
.register .num { text-align: right; font-variant-numeric: tabular-nums; }
.register .empty { text-align: center; padding: 24px; color: var(--muted); }

/* ---------------------------------------------------------- equations --- */

.sym-eq {
    min-width: auto;
    padding: 0 10px;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-size: .8125rem;
    letter-spacing: .2px;
}

.sym-eq:hover { background: var(--primary-deep); border-color: var(--primary-deep); }

/* equation placeholder, in the editor and on read-only pages */
.math { display: inline-block; padding: 0 2px; border-radius: 3px; }

.sun-editor-editable .math {
    background: #F3EBFF;
    outline: 1px solid var(--rule);
    cursor: pointer;
}

.sun-editor-editable .math:hover { outline-color: var(--primary); }

.math-dialog {
    width: min(640px, 92vw);
    padding: 24px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
}

.math-dialog::backdrop { background: rgba(34, 16, 58, .55); }
.math-dialog .h-md { color: var(--primary-ink); margin-bottom: 8px; }

.math-dialog math-field {
    display: block;
    width: 100%;
    margin: 16px 0;
    padding: 12px;
    border: 2px solid var(--rule);
    border-radius: 10px;
    font-size: 1.35rem;
}

.math-dialog math-field:focus-within { border-color: var(--primary); outline: none; }

.math-dialog-actions { display: flex; align-items: center; gap: 8px; }
.math-dialog-actions .spacer { flex: 1; }

.math-warning {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #FFF4E6;
    border-left: 3px solid var(--secondary);
    border-radius: 6px;
    font-size: .875rem;
}

/* ---------------------------------------------------------- responsive --- */

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

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 70vh;
        overflow-y: auto;
        padding: 8px var(--shell) 20px;
        background: var(--paper);
        border-bottom: 1px solid var(--rule);
        box-shadow: 0 16px 30px -18px rgba(73, 33, 101, .45);
    }

    .site-header.open .nav { display: flex; }
    .menu > a { padding: 14px 0 6px; font-size: 1rem; }
    .menu > a svg, .menu > a::after { display: none; }

    .sub {
        position: static;
        min-width: 0;
        padding: 0 0 8px;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .sub a { padding: 5px 0 5px 14px; border-left: 2px solid var(--rule); }

    /* Contact Us and Log In move from the utility strip to the top of the menu,
       where they are seen before the long list of pages */
    .utility nav { display: none; }

    .nav .menu-account {
        order: -1;
        display: flex;
        gap: 10px;
        margin-top: 8px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--rule);
    }

    .nav .menu-account .btn { flex: 1; }
    .nav .menu-account form { display: flex; flex: 1; }
}

@media (max-width: 980px) {
    .footer-top { grid-template-columns: minmax(0, 1fr); }
    .sitemap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    :root { --shell: 16px; }
    .section { padding-block: 48px; }
    .brand img { height: 40px; }

    /* phones: no utility strip at all; the hero already gives the date and venue */
    .utility { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
