@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Dark (dark blue) is the default look. Light only appears if the visitor chooses it. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f17;
  --surface: #151926;
  --ink: #eceef5;
  --muted: #9aa1b5;
  --line: #262b3b;
  --accent: #7c97ff;
  --accent-ink: #0d0f17;
  --accent-soft: #1d2440;
  --frame-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #101320;
  --muted: #566074;
  --line: #e0e4ec;
  --accent: #2247f5;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecff;
  --frame-shadow: 0 24px 60px -24px rgba(16, 19, 32, .35);
}
html { scroll-behavior: smooth; scroll-padding-top: 5rem; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand { font-family: "Bricolage", system-ui, sans-serif; letter-spacing: -.02em; color: var(--ink); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.text-muted-2 { color: var(--muted); }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--surface); padding: .5rem 1rem; }

/* Header */
/* Fixed header: stays at the top of the screen while the page scrolls. Solid colour, no transparency. */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--bg); border-bottom: 1px solid var(--line); }
@media (max-width: 991.98px) { .site-header .navbar-collapse.show, .site-header .navbar-collapse.collapsing { max-height: calc(100vh - 4.5rem); overflow-y: auto; } }
.brand { font-weight: 700; font-size: 1.25rem; }
.site-header .brand, .hero-name { font-family: "Times New Roman", Times, serif; letter-spacing: 0; }
.site-header .brand { font-size: 1.5rem; }
.navbar-brand.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-logo { width: 32px; height: 32px; flex: none; border-radius: 8px; object-fit: contain; }
.brand-logo-preview { width: 88px; height: 88px; flex: none; border-radius: 16px; object-fit: contain; background: var(--accent-soft); }
.site-header .nav-link { color: var(--ink); font-weight: 500; }
.site-header .nav-link:hover { color: var(--accent); }
.btn-theme { background: none; border: 1px solid var(--line); color: var(--ink); width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin: .5rem 0; }
.btn-theme:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .if-dark, :root:not([data-theme="light"]) .if-light { display: none; }

/* Buttons */
.btn-accent { background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 600; border-radius: .6rem; padding: .7rem 1.4rem; display: inline-flex; align-items: center; gap: .5rem; }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--accent); color: var(--accent-ink); filter: brightness(1.1); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); font-weight: 600; border-radius: .6rem; padding: .7rem 1.4rem; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero-role { color: var(--accent); font-weight: 600; margin-bottom: 1rem; }
.hero-title { font-size: clamp(2rem, 5.2vw, 3.6rem); font-weight: 700; line-height: 1.08; margin-bottom: 1.25rem; max-width: 18ch; }
.hero-lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.hero-frame { position: relative; animation: rise .7s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* Browser frame (the signature element) */
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; box-shadow: var(--frame-shadow); }
.frame-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.frame-dots { display: inline-flex; gap: .3rem; }
.frame-dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); display: block; }
.frame-url { flex: 1; min-width: 0; font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 2rem; padding: .1rem .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--accent-soft); }
.frame-empty { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 12px, var(--surface) 12px 24px); }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; margin: 0 0 .5rem; }
.section-sub { color: var(--muted); max-width: 55ch; margin: 0; }
.mt-6 { margin-top: 4rem; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 2rem; padding: .35rem 1rem; font-size: .9rem; font-weight: 500; }
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Project cards */
.project { height: 100%; display: flex; flex-direction: column; }
.project-media { display: block; }
.project-media { transition: transform .25s ease; }
.project:hover .project-media { transform: translateY(-4px); }
.project-body { padding: 1.1rem .25rem 0; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.project-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.project-title a { color: var(--ink); text-decoration: none; }
.project-title a:hover { color: var(--accent); }
.project-summary { color: var(--muted); margin: 0; }
.project-links { display: flex; gap: 1.25rem; margin-top: auto; padding-top: .5rem; align-items: center; }
.link-strong { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.link-strong:hover { text-decoration: underline; }
.link-quiet { color: var(--muted); text-decoration: none; }
.link-quiet:hover { color: var(--accent); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.tags li { font-size: .78rem; padding: .15rem .6rem; border-radius: .4rem; background: var(--accent-soft); color: var(--ink); }
.tags-lg li { font-size: .9rem; padding: .3rem .8rem; }

/* Services */

.service { border: 1px solid var(--line); border-radius: .9rem; padding: 1.25rem 1.5rem; background: var(--bg); }
.service h3 { font-size: 1.15rem; margin: 0 0 .25rem; }
.service p { margin: 0; color: var(--muted); }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .75rem; }
.contact-list a { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); }
.contact-form .form-control { background: var(--surface); border-color: var(--line); color: var(--ink); padding: .7rem .9rem; }
.contact-form .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Project detail */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 1rem; margin: 2rem 0 1.25rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.facts dt { font-weight: 500; color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.prose { max-width: 70ch; font-size: 1.05rem; }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (max-width: 575.98px) {
  .hero-frame { animation: none; }
  .btn-lg { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-frame { animation: none; }
  .project-media { transition: none; }
}
.col-thumb { width: 110px; }

/* Links around preview frames: no underline, live-site pill */
.frame-link, .frame-link:hover { text-decoration: none; color: inherit; }
.project-media, .hero-frame { position: relative; display: block; }
.visit-pill { position: absolute; right: .9rem; bottom: .9rem; display: inline-flex; align-items: center; gap: .4rem; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: .85rem; padding: .4rem .9rem; border-radius: 2rem; opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.frame-link:hover .visit-pill, .frame-link:focus-visible .visit-pill { opacity: 1; transform: none; }
@media (hover: none) { .visit-pill { opacity: 1; transform: none; } }

/* Admin extras */
.badge-count { display: inline-block; min-width: 1.4rem; padding: 0 .45rem; margin-left: .35rem; border-radius: 1rem; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4rem; }
.is-unread { border-color: var(--accent); }
.health-list dt { font-weight: 600; margin-top: .75rem; } .health-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* Services: moving hover effect */
.service-card { position: relative; overflow: hidden; transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease; }
.service-card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s ease; }
.service-card h3 { transition: color .28s ease, transform .28s ease; }
@media (hover: hover) {
  .service-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: var(--frame-shadow); }
  .service-card:hover::before { transform: scaleX(1); }
  .service-card:hover h3 { color: var(--accent); transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .service-card, .service-card h3, .service-card::before { transition: none; }
  .service-card:hover, .service-card:hover h3 { transform: none; }
}

/* Project search + type filter */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.75rem; }
.toolbar-field { flex: 1 1 15rem; max-width: 24rem; }
.toolbar .form-control, .toolbar .form-select { background-color: var(--surface); border-color: var(--line); color: var(--ink); padding: .65rem .9rem; border-radius: .6rem; }
.toolbar .form-control:focus, .toolbar .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar-count { margin: 0 0 0 auto; color: var(--muted); font-size: .9rem; }
@media (max-width: 575.98px) { .toolbar-field { max-width: none; } .toolbar-count { margin-left: 0; width: 100%; } }

/* Profile photo + name block in the hero */
.hero-id { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.hero-id p { margin: 0; }
.hero-name { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.hero-id .hero-role { margin: .15rem 0 0; }
.avatar { width: 88px; height: 88px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--accent), var(--frame-shadow); background: var(--accent-soft); }
@media (max-width: 575.98px) { .avatar { width: 72px; height: 72px; } .hero-name { font-size: 1.3rem; } }

/* Admin: SEO fields (counters, Google preview, social-share preview) */
.seo-divider { border: 0; border-top: 1px solid var(--line); opacity: 1; margin: .75rem 0 .25rem; }
.seo-count { font-weight: 400; font-size: .85rem; color: var(--muted); }
.seo-count.seo-ok { color: #2f9e5a; }
.seo-count.seo-warn { color: #c77d0a; }
.seo-prefix { background: var(--surface); border-color: var(--line); color: var(--muted); font-size: .9rem; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.contact-form .input-group .form-control { min-width: 0; }
.seo-thumb { width: 191px; height: 100px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--line); background: var(--surface); }
.seo-label { margin: 0 0 .4rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seo-serp { background: #fff; border-radius: .75rem; padding: .9rem 1.1rem; border: 1px solid #dfe1e5; font-family: Arial, Helvetica, sans-serif; overflow: hidden; }
.seo-serp-site { font-size: .8rem; color: #4d5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-serp-title { font-size: 1.2rem; line-height: 1.3; color: #1a0dab; margin: .2rem 0 .15rem; overflow-wrap: anywhere; }
.seo-serp-desc { font-size: .88rem; line-height: 1.5; color: #4d5156; overflow-wrap: anywhere; }
.seo-share { background: #fff; border-radius: .75rem; border: 1px solid #dfe1e5; overflow: hidden; font-family: Arial, Helvetica, sans-serif; max-width: 30rem; }
.seo-share img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: #e9ebee; }
.seo-share-body { padding: .6rem .85rem .75rem; background: #f2f3f5; }
.seo-share-host { font-size: .7rem; letter-spacing: .02em; color: #65676b; }
.seo-share-title { font-size: .95rem; font-weight: 600; line-height: 1.3; color: #1c1e21; margin-top: .1rem; overflow-wrap: anywhere; }
.seo-share-desc { font-size: .8rem; line-height: 1.4; color: #65676b; margin-top: .1rem; overflow-wrap: anywhere; }
