/*------------------------------------------------
  Site customizations, loaded after theme.css.

  1. Palette (light / dark)
  2. Typography
  3. Components
  4. Header icons
  5. Theme toggle

  The palette softens the theme's pure black / pure white for a calmer
  read: charcoal headings, mid-gray body copy (WCAG AA on white) and
  medium-weight titles. Dark mode is <html data-theme="dark">.
-------------------------------------------------*/

/*------------------------------------------------
  1. Palette
-------------------------------------------------*/
:root {
    /* One ink color for headings, the nav card and solid buttons, so they match */
    --ink: #1a1c20;
    --page-bg: #ffffff;
    --surface: #ffffff;
    --surface-shadow: 0 8px 26px 0 rgba(22, 24, 26, 0.07);
    --surface-shadow-hover: 0 8px 32px 0 rgba(22, 24, 26, 0.11);
    --heading: var(--ink);          /* titles, labels, icons */
    --text: #6c6f73;                /* body copy */
    --link: rgba(26, 28, 32, 0.8);
    --placeholder: #a3a5a8;
    --line: rgba(26, 28, 32, 0.18); /* dashed borders */
    --grid-line: #e7e9eb;           /* background vertical lines */
    --grid-drop: rgba(26, 28, 32, 0.35);
    --accent: var(--ink);           /* solid buttons */
    --on-accent: #ffffff;
    /* Section nav: an ink card (same color as the headings) with neutral light text */
    --nav-bg: var(--ink);
    --nav-bg-fixed: rgba(26, 28, 32, 0.95);
    --nav-text: #a3a6ab;
    --nav-text-active: #f2f3f5;
}

[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #0c0d0e;
    --surface: #151618;
    --surface-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --surface-shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.08);
    --heading: #e4e5e7;
    --text: #a0a2a6;
    --link: rgba(228, 229, 231, 0.8);
    --placeholder: #6f7175;
    --line: rgba(255, 255, 255, 0.18);
    --grid-line: rgba(255, 255, 255, 0.06);
    --grid-drop: rgba(255, 255, 255, 0.3);
    --accent: #e4e5e7;
    --on-accent: #151618;
    --nav-bg: #1f2123;
    --nav-bg-fixed: rgba(31, 33, 35, 0.95);
}

/*------------------------------------------------
  2. Typography
-------------------------------------------------*/
body {
    background: var(--page-bg);
    color: var(--text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading);
    font-weight: 500;
}

/* Bootstrap's .text-black utility is !important */
.text-black {
    color: var(--heading) !important;
}

::selection {
    background: var(--heading);
    color: var(--page-bg);
}

.blog-post-box .blog-post-caption h2 {
    font-size: 1.5rem;
    line-height: 1.3;
}

@media (min-width: 1200px) {
    .blog-post-box .blog-post-caption h2 {
        font-size: 1.75rem;
    }
}

/*------------------------------------------------
  3. Components
-------------------------------------------------*/
a {
    color: var(--link);
}

a:hover,
.link-decoration,
.link-decoration:hover,
.link-decoration:focus {
    color: var(--heading);
}

/* Surfaces */
.section-box {
    background: var(--surface);
    box-shadow: var(--surface-shadow);
}

.section-box:hover {
    box-shadow: var(--surface-shadow-hover);
}

/* Background vertical lines */
.bg-lines .bg-line-1,
.bg-lines .bg-line-2,
.bg-lines .bg-line-3,
.bg-lines .bg-line-4 {
    border-right-color: var(--grid-line);
}

.bg-lines .bg-line-1:before,
.bg-lines .bg-line-2:before,
.bg-lines .bg-line-3:before,
.bg-lines .bg-line-4:before {
    background: linear-gradient(transparent, var(--grid-drop));
}

/* Outlined text and section labels */
.stroke-text,
.title-heading:after {
    color: var(--heading);
    -webkit-text-stroke-color: var(--heading);
}

/* Avatar */
.hero-avatar img {
    border-color: var(--line);
}

/* Pills */
ul.list-inline-pills li {
    border-color: var(--line);
}

ul.list-inline-pills li:hover {
    color: var(--heading);
}

/* Section navigation */
.section-nav {
    background: var(--nav-bg);
}

.section-nav ul li a,
.section-nav ul li button,
.section-nav ul li a:focus,
.section-nav ul li button:focus {
    color: var(--nav-text);
}

.section-nav ul li a:hover,
.section-nav ul li a.active,
.section-nav ul li button:hover,
.section-nav ul li button.active {
    color: var(--nav-text-active);
}

@media (min-width: 992px) {
    /* Dots and the active ring */
    .section-nav ul li .nav-circle:before {
        background: var(--nav-text-active);
        border-color: var(--nav-text-active);
    }
}

@media (max-width: 991.98px) {
    .section-nav.fixed {
        background: var(--nav-bg-fixed);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px); /* content scrolling underneath reads as a soft haze */
    }

    .section-nav ul li a:before,
    .section-nav ul li button:before {
        border-color: var(--nav-text-active);
    }
}

/* Buttons */
.button.button-dark {
    background: var(--accent);
    color: var(--on-accent);
}

.button.button-dark:hover {
    background: var(--accent);
    color: var(--on-accent);
    opacity: 0.88;
}

.button.button-outline-dark {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.button.button-outline-dark:hover,
.button-circle-outline-dark:hover,
.button-circle-outline-dark:focus,
.swiper-custom-prev:focus:hover,
.swiper-custom-next:focus:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.button-circle {
    color: var(--heading);
}

.button-circle:hover {
    color: var(--text);
}

.button-circle-outline-dark {
    border-color: var(--accent);
    color: var(--accent);
}

.swiper-custom-prev:focus,
.swiper-custom-next:focus {
    color: var(--accent);
}

/* Forms */
input:not(.form-check-input),
textarea {
    background: transparent;
    border-color: var(--line);
    color: var(--heading);
}

input:not(.form-check-input):focus,
input:not(.form-check-input):active,
textarea:focus,
textarea:active {
    border-color: var(--heading);
}

input:not(.form-check-input)::placeholder,
textarea::placeholder {
    color: var(--placeholder);
}

/* Resume timeline */
.resume-wrapper:before {
    border-left-color: var(--line);
}

.resume-wrapper .resume-box .resume-date {
    border-color: var(--line);
}

.resume-wrapper .resume-box .resume-date:before {
    border-top-color: var(--line);
}

.resume-wrapper .resume-box .resume-date:after {
    background: var(--heading);
}

.resume-wrapper .resume-box:hover .resume-date {
    color: var(--heading);
}

/* Services */
.services-list .services-item {
    border-top-color: var(--line);
}

.services-list .services-item .services-title i {
    color: var(--heading);
}

/* Portfolio filter */
.filter ul li {
    border-color: var(--accent);
    color: var(--accent);
}

.filter ul li:hover,
.filter ul li.mixitup-control-active {
    background: var(--accent);
    color: var(--on-accent);
}

/* Calendly badge (its colors are set inline by the widget) */
[data-theme="dark"] .calendly-badge-widget .calendly-badge-content {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
}

/*------------------------------------------------
  4. Header icons

  SVG icons: official brand marks for platforms, Remix Icon for
  the rest (sizes are set in src/components/icons.tsx).
-------------------------------------------------*/
/* One row, every item centred on the same middle line */
.header-social {
    display: inline-flex;
    align-items: center;
}

.header-social li {
    display: flex;
    align-items: center;
}

.header-social .button-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-social .button-circle svg {
    display: block;
    flex-shrink: 0;
}

/*------------------------------------------------
  5. Theme toggle
-------------------------------------------------*/
button.button-circle {
    padding: 0;
    border: 0;
    background: transparent;
}

/* Moon in light mode, sun in dark mode */
:root:not([data-theme="dark"]) .theme-toggle .theme-icon-sun,
[data-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}
