/* ==========================================================================
   SRI SUN — Design System
   Tokens and shared primitives. Loaded before styles.css.
   The brand accent (#DC2626) is used deliberately: primary actions, active
   states, links and a small number of accents. Everything else is neutral.
   ========================================================================== */

:root {
    /* --- Brand ------------------------------------------------------- */
    --primary-color: #dc2626;
    --primary-hover: #b91c1c;
    --primary-active: #991b1b;
    --primary-tint: #fef2f2;
    --primary-tint-strong: #fee2e2;
    --primary-border: #fecaca;
    --primary-ring: rgba(220, 38, 38, 0.22);
    /* The brand red does not carry enough contrast on the dark bands. */
    --primary-on-dark: #f87171;

    /* Legacy alias kept so existing rules keep resolving. */
    --secondary-color: #374151;

    /* --- Neutrals ---------------------------------------------------- */
    --ink: #111827;          /* headings */
    --ink-soft: #1f2937;
    --body: #4b5563;         /* body copy */
    --muted: #6b7280;        /* secondary copy */
    --faint: #9ca3af;        /* placeholders, meta */

    --surface: #ffffff;
    --surface-subtle: #f9fafb;
    --surface-sunken: #f3f4f6;
    --surface-deep: #e5e7eb;   /* footer band */
    --surface-inverse: #111827;

    --line: #e5e7eb;
    --line-soft: #f0f1f3;
    --line-strong: #d1d5db;

    /* Legacy aliases */
    --dark-color: #111827;
    --light-color: #f9fafb;

    /* --- Typography -------------------------------------------------- */
    --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

    --text-2xs: 0.6875rem;   /* 11px */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.8125rem;    /* 13px */
    --text-base: 0.9375rem;  /* 15px */
    --text-md: 1rem;         /* 16px */
    --text-lg: 1.0625rem;    /* 17px */

    --h1: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
    --h2: clamp(1.625rem, 1.35rem + 1.15vw, 2.125rem);
    --h3: clamp(1.1875rem, 1.08rem + 0.45vw, 1.4375rem);
    --h4: 1.0625rem;

    --leading-tight: 1.2;
    --leading-snug: 1.4;
    --leading-normal: 1.65;
    --leading-relaxed: 1.75;

    --tracking-tight: -0.015em;
    --tracking-normal: 0;
    --tracking-wide: 0.04em;
    --tracking-caps: 0.08em;

    /* --- Space ------------------------------------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    --section-y: clamp(64px, 7.5vw, 120px);
    --container-max: 1200px;
    --container-wide: 1360px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 72px;

    /* --- Shape ------------------------------------------------------- */
    --radius-sm: 3px;
    --radius: 4px;
    --radius-lg: 6px;
    --radius-pill: 999px;

    --border: 1px solid var(--line);
    --border-strong: 1px solid var(--line-strong);

    /* --- Elevation (used sparingly) ---------------------------------- */
    --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.05);
    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.07);
    --shadow-overlay: 0 16px 40px rgba(17, 24, 39, 0.14);

    /* --- Motion ------------------------------------------------------ */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 120ms;
    --dur: 180ms;
    --dur-slow: 280ms;
    --transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease),
                  border-color var(--dur) var(--ease), opacity var(--dur) var(--ease),
                  transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);

    --focus-ring: 0 0 0 3px var(--primary-ring);

    --z-header: 1000;
    --z-dropdown: 1010;
    --z-drawer: 1080;
    --z-modal: 2000;
}

@media (max-width: 768px) {
    :root { --header-h: 60px; }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--body);
    background-color: var(--surface);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

img { height: auto; }

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

h1 { font-size: var(--h1); font-weight: 700; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); letter-spacing: var(--tracking-normal); }

p { text-wrap: pretty; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}

ul, ol { list-style-position: outside; }

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button { background: none; border: none; cursor: pointer; }

::selection {
    background: var(--primary-tint-strong);
    color: var(--primary-active);
}

/* Visible, consistent focus for keyboard users only. */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: calc(var(--z-modal) + 1);
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transition: top var(--dur) var(--ease);
}

.skip-link:focus {
    top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--wide { max-width: var(--container-wide); }

section {
    padding-block: var(--section-y);
}

.text-center { text-align: center; }

/* Section heading block --------------------------------------------------- */

.section-title {
    font-size: var(--h2);
    color: var(--ink);
    text-align: center;
    margin-bottom: var(--space-4);
}

/* One short accent rule, not a decorative gradient bar. */
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    margin: var(--space-4) auto 0;
    background: var(--primary-color);
}

.section-description {
    max-width: 62ch;
    margin: 0 auto var(--space-12);
    text-align: center;
    color: var(--muted);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

/* Section masthead --------------------------------------------------------
   Title left, standfirst right, under a single accent rule that spans the
   container. Used on the long-form pages so their headers sit on the same
   grid as the ruled content beneath them. Aliases cover the existing markup
   so no template needs a new class. */

.section-head,
.service-intro,
.goals-intro,
.values-header,
.section-intro {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 1.1fr);
    gap: var(--space-4) clamp(24px, 4vw, 72px);
    align-items: end;
    max-width: none;
    margin: 0 0 var(--space-12);
    padding-top: var(--space-6);
    border-top: 2px solid var(--primary-color);
    text-align: left;
}

.section-head > h2,
.service-intro > h2,
.goals-intro > h2,
.values-header > h2,
.section-intro > h2 {
    margin: 0;
    font-size: var(--h2);
    color: var(--ink);
    text-align: left;
}

/* The rule above the block replaces the one that used to dangle below. */
.section-head > h2::after,
.service-intro > h2::after,
.goals-intro > h2::after,
.values-header > h2::after,
.section-intro > h2::after {
    content: none;
}

.section-head > p,
.service-intro > p,
.goals-intro > p,
.values-header > p,
.section-intro > p {
    margin: 0;
    padding-bottom: 3px;
    color: var(--muted);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

@media (max-width: 860px) {
    .section-head,
    .service-intro,
    .goals-intro,
    .values-header,
    .section-intro {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        margin-bottom: var(--space-10);
    }

    .section-head > p,
    .service-intro > p,
    .goals-intro > p,
    .values-header > p,
    .section-intro > p {
        max-width: 62ch;
        padding-bottom: 0;
    }
}

.eyebrow {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn,
.cta-button,
.btn-cta,
.apply-btn {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-border: var(--line-strong);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 11px 20px;
    min-height: 42px;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius);
    background-color: var(--btn-bg);
    color: var(--btn-fg);
    font-size: var(--text-base);
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
                color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn:hover,
.cta-button:hover,
.btn-cta:hover,
.apply-btn:hover {
    background-color: var(--surface-sunken);
}

.btn:active,
.cta-button:active,
.btn-cta:active,
.apply-btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled='true'] {
    opacity: 0.55;
    pointer-events: none;
}

/* Primary — the brand action */
.btn-primary,
.cta-button.primary,
.btn-cta,
.apply-btn {
    --btn-bg: var(--primary-color);
    --btn-fg: #fff;
    --btn-border: var(--primary-color);
}

.btn-primary:hover,
.cta-button.primary:hover,
.btn-cta:hover,
.apply-btn:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-primary:active,
.cta-button.primary:active,
.btn-cta:active,
.apply-btn:active {
    background-color: var(--primary-active);
    border-color: var(--primary-active);
}

/* Secondary — neutral outline */
.btn-secondary,
.cta-button.secondary {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-border: var(--line-strong);
}

.btn-secondary:hover,
.cta-button.secondary:hover {
    background-color: var(--surface-sunken);
    border-color: var(--line-strong);
    color: var(--ink);
}

/* On dark or photographic backgrounds */
.on-dark .btn-secondary,
.on-dark .cta-button.secondary {
    --btn-fg: #fff;
    --btn-border: rgba(255, 255, 255, 0.45);
    background-color: rgba(255, 255, 255, 0.08);
}

.on-dark .btn-secondary:hover,
.on-dark .cta-button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: #fff;
    color: #fff;
}

/* On the solid accent panel: white button reads as primary. */
.on-accent .cta-button.primary,
.on-accent .btn-primary {
    background-color: #fff;
    border-color: #fff;
    color: var(--primary-hover);
}

.on-accent .cta-button.primary:hover,
.on-accent .btn-primary:hover {
    background-color: var(--primary-tint);
    border-color: var(--primary-tint);
    color: var(--primary-active);
}

.on-accent .cta-button.secondary,
.on-accent .btn-secondary {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.on-accent .cta-button.secondary:hover,
.on-accent .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--primary-color);
    --btn-border: transparent;
    padding-inline: var(--space-3);
}

.btn-ghost:hover {
    background-color: var(--primary-tint);
}

.btn-sm,
.apply-btn {
    padding: 7px 14px;
    min-height: 34px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 14px 26px;
    min-height: 48px;
    font-size: var(--text-md);
}

.btn-block { display: flex; width: 100%; }

/* Text link with the brand accent */
.link {
    color: var(--primary-color);
    font-weight: 500;
    text-underline-offset: 3px;
}

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

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
}

.form-hint {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--muted);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='url'],
input[type='number'],
input[type='search'],
input[type='password'],
input[type='date'],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    min-height: 44px;
    background-color: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: var(--text-base);
    line-height: 1.45;
    color: var(--ink);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--faint);
    opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

input[aria-invalid='true'],
textarea[aria-invalid='true'],
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--primary-color);
}

.error-message {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--primary-hover);
}

/* ==========================================================================
   Alerts
   ========================================================================== */

/* Status is carried by the border and fill together, so no accent edge. */
.alert {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: var(--surface-subtle);
    color: var(--ink-soft);
    font-size: var(--text-base);
    line-height: var(--leading-snug);
}

.alert-success {
    border-color: #bbf7d0;
    background-color: #f0fdf4;
    color: #14532d;
}

.alert-error {
    border-color: var(--primary-border);
    background-color: var(--primary-tint);
    color: #7f1d1d;
}

.alert-info {
    border-color: var(--line);
    background-color: var(--surface-subtle);
}

/* ==========================================================================
   Cards & panels — restrained by default
   ========================================================================== */

.card {
    background-color: var(--surface);
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.card--interactive {
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card--interactive:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.panel {
    background-color: var(--surface-subtle);
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.divider {
    height: 1px;
    border: 0;
    background-color: var(--line);
    margin-block: var(--space-8);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap,
.job-table-container {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    -webkit-overflow-scrolling: touch;
}

/* Tables scroll inside their own container rather than widening the page. */
.table,
.job-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background-color: var(--surface);
    font-size: var(--text-base);
}

.table th,
.job-table th {
    padding: var(--space-3) var(--space-5);
    text-align: left;
    background-color: var(--surface-subtle);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    white-space: nowrap;
}

.table td,
.job-table td {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--line-soft);
    color: var(--body);
    vertical-align: middle;
}

.table tbody tr:last-child td,
.job-table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr,
.job-table tbody tr {
    transition: background-color var(--dur-fast) var(--ease);
}

.table tbody tr:hover,
.job-table tbody tr:hover {
    background-color: var(--surface-subtle);
}

.table td:first-child,
.job-table td:first-child {
    color: var(--ink);
    font-weight: 500;
}

/* ==========================================================================
   Badges & chips
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: var(--surface-subtle);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.badge--accent {
    border-color: var(--primary-border);
    background-color: var(--primary-tint);
    color: var(--primary-hover);
}

/* ==========================================================================
   Breadcrumb (sits on dark page banners)
   ========================================================================== */

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.01em;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.72);
    text-underline-offset: 3px;
}

.breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb span {
    color: #fff;
    font-weight: 500;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    overflow-y: auto;
    padding: var(--gutter);
    background-color: rgba(17, 24, 39, 0.55);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: clamp(24px, 8vh, 80px) auto;
    padding: var(--space-8);
    background-color: var(--surface);
    border: var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    transform: translateY(-8px);
    opacity: 0;
    transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease);
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.close-modal:hover,
.close-modal:focus {
    background-color: var(--surface-sunken);
    color: var(--ink);
}

/* ==========================================================================
   States: loading, empty, error
   ========================================================================== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--line);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner--lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.state-block {
    padding: var(--space-12) var(--space-6);
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background-color: var(--surface-subtle);
}

.state-block h3 {
    font-size: var(--h4);
    margin-bottom: var(--space-2);
}

.state-block p {
    color: var(--muted);
    font-size: var(--text-base);
    max-width: 46ch;
    margin-inline: auto;
}

.state-block .btn { margin-top: var(--space-5); }

.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Reveal-on-scroll. The class is added by JS, so content is never hidden
   when scripts fail to load. */
/* Deliberately small: a short rise and a fade. No scale, no slide-in. */
.js-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.js-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js-reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.stack > * + * { margin-top: var(--space-4); }
