/* style.css — cards: NO default halo/shadow, only on hover/focus */

/* ===== Design tokens – black-to-charcoal scale ===== */
:root{
  /* page background = real black */
  --bg:#000000;

  /* cards / panels = very dark charcoal */
  --panel:rgba(22,22,22,0.78);   /* #161616 + slight transparency */

  /* text colours – keep the same contrast */
  --muted:#a8aeb3;
  --muted-2:#939ca3;
  --text:#f2f2f2;

  /* accent stays orange */
  --accent:#ff6b00;
  --accent-strong:#ff4500;

  /* rest untouched */
  --radius:8px;
  --container:1100px;
  --focus:3px rgba(255,107,0,0.15);
}

/* ---------- Reset & base ---------- */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.5}
a{color:var(--muted);text-decoration:none}
a:hover{color:var(--accent)}
.container{max-width:var(--container);margin:0 auto;padding:0 1rem}
.skip-link{position:absolute;left:-999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{left:1rem;top:1rem;width:auto;height:auto;background:#111;padding:.5rem .75rem;border-radius:6px;z-index:9999;color:var(--text)}

/* ---------- Background blobs + noise ---------- */
.animated-bg{position:fixed;inset:0;z-index:-2;overflow:hidden;background:var(--bg)}
.animated-bg::before,.animated-bg::after{
  content:"";position:absolute;inset:-80%;width:260%;height:260%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,107,0,0.14) 0%, transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(0,150,255,0.10) 0%, transparent 35%);
  filter:blur(80px);animation:move 28s linear infinite;will-change:transform}
.animated-bg::after{animation-delay:-14s}
.noise{position:absolute;inset:0;opacity:.03;background:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg '%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");pointer-events:none}
@keyframes move{0%{transform:translate(0,0) rotate(0)}50%{transform:translate(-3%,4%) rotate(180deg)}100%{transform:translate(0,0) rotate(360deg)}}

/* ---------- Header ---------- */
header.site-header{position:fixed;top:0;width:100%;background:rgba(12,12,12,0.68);backdrop-filter:blur(8px);z-index:1000;box-shadow:0 2px 8px rgba(0,0,0,.4)}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:.85rem 1rem}

.hamburger{display:none;background:transparent;border:0;color:var(--text);font-size:1.3rem}
nav.nav ul{display:flex;gap:1.2rem;list-style:none;margin:0;padding:0}
nav.nav a{padding:.25rem .25rem;color:var(--muted)}
nav.nav a:hover{color:var(--accent)}

/* ---------- HERO ---------- */
.hero{min-height:72vh;padding:85px 0 3.5rem;display:flex;align-items:center;justify-content:center;text-align:center;position:relative}
.hero-inner{max-width:960px;margin:0 auto}
.hero-avatar{width:130px;height:130px;border-radius:50%;object-fit:cover;border:3px solid var(--accent);display:block;margin:0 auto 1rem}
h1{font-size:2rem;margin:.25rem 0}
.highlight{color:var(--text)}
.tagline{color:var(--muted);margin:0 0 1rem}
#typewrite{font-family:"Courier New", Courier, monospace;color:#e6eef6;min-height:2.2rem;font-size:1.12rem}
.hero-divider{display:flex;align-items:center;justify-content:center;gap:12px;margin:1rem 0;pointer-events:none}
.hero-divider .line{width:170px;height:2px;background:linear-gradient(90deg,transparent,var(--accent),transparent)}
.chess-chip{background: rgba(255,255,255,0.04);backdrop-filter: blur(6px);padding:10px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;box-shadow: 0 6px 18px rgba(0,0,0,0.45);transform: translateY(0);}
.chess-icon{color:var(--accent);font-size:20px}
.hero-cta{display:grid;grid-template-columns:1fr;gap:12px;margin-top:1.5rem;justify-items:center}
.btn-hero{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.6rem 1rem;border-radius:28px;font-weight:700;min-height:52px}
.btn-primary{background:linear-gradient(135deg,var(--accent-strong),var(--accent));color:#fff;border:1px solid rgba(255,255,255,0.03);box-shadow:0 10px 26px rgba(255,107,0,0.07)}
.btn-hero:focus{outline:none;box-shadow:var(--focus)}
.btn-hero:hover{transform:translateY(-2px)}

/* ---------- SECTIONS & CARDS ---------- */
.section{padding:40px 0}
.section-title{text-align:center;margin-bottom:40px;font-size:1.6rem;font-weight:400;color:#fff}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.25rem}
.card{background:var(--panel);border-radius:var(--radius);padding:1rem;display:flex;flex-direction:column;min-height:140px;transition:transform .18s,border-color .18s,box-shadow .22s;position:relative;overflow:visible;border:2px solid transparent}
.card:hover{transform:translateY(-6px)}
.card-icon{font-size:1.3rem;color:var(--accent);text-align:center;padding-top:.6rem}
.card-body{flex:1;padding:.6rem 0;text-align:center;color:var(--muted-2)}
#services .card-body h3, #portfolio .card-body h3, #articles .card-body h3 {text-decoration:none;font-size:1.05rem;font-weight:600;color:#fff;margin:.2rem 0}
.card-body p{font-size:.95rem;color:#dbe7ef}
.card-actions{text-align:center;padding-top:.6rem}
.cta-secondary{display:inline-block;padding:.5rem 1rem;border-radius:999px;border:1px solid rgba(255,255,255,0.04);color:var(--muted-2);background:transparent}
.cta-secondary:hover{border-color:var(--accent);color:var(--accent)}
.card-actions .service-btn, .card-actions a.service-btn, button.service-btn{background:#2f2f2f;color:var(--accent);border:1px solid rgba(255,255,255,0.04);padding:.5rem 1rem;border-radius:999px;font-weight:700}
.card-actions .service-btn:hover, .card-actions a.service-btn:hover, button.service-btn:hover{background:#444;color:var(--accent);border-color:var(--accent);transform:translateY(-2px)}

/* ---------- Halo: invisible until hover/focus ---------- */
.card::before{
  content:"";position:absolute;inset:-8px;border-radius:calc(var(--radius) + 8px);
  background: conic-gradient(from 0deg, #ff6b00, #ff0000, #00bfff, #007bff, #ff6b00);
  opacity:0;filter: blur(12px);z-index:-1;transition:opacity .35s cubic-bezier(.2,.9,.2,1), transform .35s ease;
  transform: scale(.98);pointer-events:none}
.card:hover::before,.card:focus-within::before{opacity:0.7;transform:scale(1)}
.card:active::before{opacity:0.98;transform:scale(1.02);filter:blur(8px)}
.card.appear{} /* keeps JS timing intact – no visual effect */

/* ---------- CONTACT / SOCIALS ---------- */
.socials{display:flex;gap:1.2rem;justify-content:center;align-items:center;padding-top:.5rem}
.socials a{color:var(--muted);font-size:1.2rem}
.socials a:hover{color:var(--accent)}

/* ---------- MODALS ---------- */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(2,6,23,0.65);z-index:9998;padding:1rem}
.modal[aria-hidden="false"]{display:flex}
.modal-card{width:min(760px,96%);background:#0f1114;color:#eaf2fb;padding:1rem;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,.6)}
.modal-head{display:flex;justify-content:space-between;align-items:center}
.close{background:transparent;border:0;color:#9aa4b2;font-size:1.2rem}
.modal-row{display:flex;gap:.75rem}
.modal-row input,.modal-row select,.modal-card input,.modal-card textarea{width:100%;padding:.6rem;border-radius:8px;border:1px solid rgba(255,255,255,0.05);background:transparent;color:var(--text)}
.modal-foot{display:flex;gap:.75rem;justify-content:flex-end;margin-top:0.75rem}
.form-msg{color:var(--muted);margin-top:.5rem}
.chat-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(2,6,23,0.85);z-index:10000}
.chat-modal[aria-hidden="false"]{display:flex}
.chat-modal-content{width:min(95vw,900px);height:min(95vh,720px);background:#0f1114;border-radius:12px;overflow:hidden;position:relative}
#chatFrame{width:100%;height:100%;border:0}
.thinking-bubble{position:absolute;top:12px;left:12px;padding:.5rem .75rem;background:#111;border-radius:8px;color:#cfd8e3;display:none}
.thinking-bubble[aria-hidden="false"]{display:block}

/* ---------- Responsiveness ---------- */
@media (max-width:900px){
  .hero-cta{grid-template-columns:1fr;gap:10px}
  .hamburger{display:block}
  nav.nav ul{position:fixed;right:-100%;top:60px;flex-direction:column;background:rgba(18,18,18,0.95);width:220px;height:100vh;padding:1.5rem;transition:right .25s}
  nav.nav ul.active{right:0}
}

/* ---------- Accessibility helpers ---------- */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
:focus{outline:none}
button:focus,a:focus{box-shadow:var(--focus);border-radius:6px}

/* ---------------------------------------------------
   1.  KILL THE BLOBS
---------------------------------------------------- */
.animated-bg,
.animated-bg::before,
.animated-bg::after,
.noise {
  display: none;          /* removes blobs + noise */
}

/* ---------------------------------------------------
   2.  GREY-SCALE STRIPES FOR SECTIONS
---------------------------------------------------- */
/* base page = real black */
body {
  background: #000;
}

/* every section gets its own grey */
.section:nth-of-type(odd)  { background: #0a0a0a; }   /* almost black */
.section:nth-of-type(even) { background: #111111; }   /* 1 step lighter */

/* if you need finer control, target the IDs explicitly */
#home,
#portfolio,
#services            { background: #080808; }

#about,
#articles,
#contact             { background: #121212; }

/* keep cards dark but slightly transparent so the section
   colour shows through a little */
.card {
  background: rgba(25,25,25,.82);
}

/* ---------------------------------------------------
   3.  (optional) tiny separator between sections
---------------------------------------------------- */
.section + .section {
  box-shadow: inset 0  1px 0 0 rgba(255,255,255,.04);
}

/* ----------------------------------------------------------
   Knight chess icon – flat, stroked, mouse-tracking
----------------------------------------------------------- */
.chess-chip {
  background: none;          /* 1. kill the rectangle */
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;                /* keep the wrapper for positioning */
}

.chess-icon {
  display: block;
  font-size: 20px;
  color: transparent;        /* 2. fill = transparent */
  -webkit-text-stroke: 1px var(--accent); /* thin orange border */
  text-stroke: 1px var(--accent);
  transform-origin: 50% 50%;
  transition: transform .15s ease-out;
}

/* 3. rotate on mouse-move (JS will add the --angle custom prop) */
.chess-icon {
  transform: rotate(var(--angle, 0deg));
}

/* final, subtle checkerboard */
#home::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;                /* push one layer further back */
  pointer-events:none;
  --line: rgba(160,160,160,.15);
  --size: 24px;
  background-image:
    repeating-linear-gradient(90deg,
      transparent 0 calc(var(--size) - 1px),
      var(--line) calc(var(--size) - 1px) var(--size)),
    repeating-linear-gradient(0deg,
      transparent 0 calc(var(--size) - 1px),
      var(--line) calc(var(--size) - 1px) var(--size));
}
/* ---------- HERO GRID + NEON NODES (Option 2) — robust version ---------- */
/* Place this at the end of style.css and hard-refresh the page */

/* ensure hero creates a stacking context and the grid sits *behind* hero content */
#home.hero { position: relative; overflow: hidden; z-index: 0; }

/* container for the svg grid */
#home.hero .hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;               /* behind hero text/content, above page background */
  pointer-events: none;
  display: block;
  opacity: 1;                /* keep visible by default */
}

/* svg should fill the area */
#home.hero .hero-grid-svg { width: 100%; height: 100%; display: block; }

/* Grid lines: ensure visible but subtle */
#home.hero .grid-lines { opacity: 0.95; mix-blend-mode: screen; stroke-linecap: round; }

/* Nodes: make sure SVG transforms behave consistently across browsers */
#home.hero .node {
  transform-origin: center center;       /* center of the element */
  transform-box: fill-box;               /* necessary for SVG transforms */
  will-change: transform, opacity, filter;
  opacity: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
  mix-blend-mode: screen;
  transition: opacity .24s ease, transform .24s ease;
}

/* Stronger visibility for nodes so they are clearly visible across themes */
#home.hero .node { stroke: none; }

/* Staggered pulsing — GPU-friendly (scale only) */
#home.hero .node-a { animation: hero-node-pulse 3.6s cubic-bezier(.2,.9,.3,.95) infinite; }
#home.hero .node-b { animation: hero-node-pulse 4.2s cubic-bezier(.2,.9,.3,.95) infinite; animation-delay: .35s; }
#home.hero .node-c { animation: hero-node-pulse 3.2s cubic-bezier(.2,.9,.3,.95) infinite; animation-delay: .75s; }
#home.hero .node-d { animation: hero-node-pulse 4.0s cubic-bezier(.2,.9,.3,.95) infinite; animation-delay: 1.05s; }
#home.hero .node-e { animation: hero-node-pulse 3.9s cubic-bezier(.2,.9,.3,.95) infinite; animation-delay: 1.45s; }

@keyframes hero-node-pulse {
  0%   { transform: scale(.92); opacity:.82; filter: blur(0px) brightness(1); }
  50%  { transform: scale(1.18); opacity:1;    filter: blur(.6px) brightness(1.05); }
  100% { transform: scale(.92); opacity:.82; filter: blur(0px) brightness(1); }
}

/* connectors: keep extremely subtle */
#home.hero .connectors { opacity: 0.08; mix-blend-mode: screen; }

/* reduce density & intensity on small screens */
@media (max-width: 720px) {
  #home.hero .grid-lines { opacity: 0.26; }
  #home.hero .connectors { opacity: 0.05; }
  #home.hero .node { opacity: 0.95; }
}

/* accessibility: stop animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  #home.hero .node,
  #home.hero .node-a,
  #home.hero .node-b,
  #home.hero .node-c,
  #home.hero .node-d,
  #home.hero .node-e {
    animation: none !important;
    transform: none !important;
    opacity: .95 !important;
  }
}

#home.hero .grid-lines {
  stroke: url(#gridGradient); /* uses the gradient defined in index.html */
  stroke-width: 1;
  opacity: 0.85;              /* stronger visibility */
  mix-blend-mode: screen;
}
/* Fade the CSS checkerboard / subtle lines under #home so they disappear earlier */
#home::before {
  /* keep existing visuals but fade them vertically via mask */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 55%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 55%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  /* safety: ensure pseudo stays behind SVG grid */
  z-index: -3;
  pointer-events: none;
}

.hero img,
.profile-pic {
  border: none !important;
  box-shadow: none !important;
  border-radius: 50%; /* keeps circular crop */
}

#typewrite {
  position: relative;
  min-height: 2.8rem;
  box-sizing: border-box;
  width: max-content; /* fit content width */
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  overflow: visible;
  white-space: nowrap; /* prevent breaking */
}

#typewrite .tw-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-block;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  text-align: center;
  line-height: 1.25;
  word-break: normal;
  hyphens: none;
}

/* MOBILE — scale font instead of breaking lines */
@media (max-width: 420px) {
  #typewrite {
    width: auto;
  }
  #typewrite .tw-inner {
    font-size: 14px; /* smaller font for mobile */
  }
}
.logo-img {
  background: transparent !important;
}
.logo-img {
  position: relative;
}
.logo-img::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(130deg, rgba(255,255,255,.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
}
.logo-img:hover::after {
  opacity: 1;
}
.logo-img {
  display: block;
  height: 34px;              /* adjust size */
  width: auto;               /* keep aspect ratio */
  border-radius: 6px;        /* slightly rounded */
  object-fit: contain;
  transition: transform .25s ease, filter .25s ease, box-shadow .25s ease;
}
.logo-img:hover {
  filter: drop-shadow(0 0 6px var(--accent));
  transform: scale(1.08);
}

/* ---------- Portfolio re-grid ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.big-cards,
.small-cards {
  display: grid;
  gap: 1.25rem;
}

.big-cards { grid-template-rows: 1fr 1fr; }   /* 2 equal rows */
.small-cards { grid-template-columns: 1fr; }  /* single column, 4 rows */

/* mobile: single column */
@media (max-width: 720px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ---- 1. button below subtitle (already done by markup) ---- */

/* ---- 2. image fills empty card space ---- */
.card-fill-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: .75rem;
  object-fit: cover;
  flex-grow: 1;          /* eat remaining vertical space */
}

/* ---- 3. kill mouse-move colour effect on ALL cards ---- */
.card::before,
.card:hover::before,
.card:focus-within::before,
.card:active::before {
  display: none !important;
}

/* widen big cards, shrink small cards */
.portfolio-grid {
  grid-template-columns: 1.5fr 1fr;   /* 2 : 1 ratio */
  gap: 1rem;                      /* slightly wider gutter */
}

/* optional fine-tuning */
.big-cards   .card { padding: 1rem; }
.small-cards .card { padding: .8rem;   }

/* mobile: back to even columns */
@media (max-width: 720px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ---- Insight split layout ---- */
.about-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr; /* text wider, image narrower */
  gap: 2.5rem;
  align-items: center;
}

.about-text { padding-right: 1rem; }

.about-image {
  text-align: right;          /* keep image on its own line */
}
.about-image img {
  width: 70%;                 /* smaller */
  max-width: 280px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 15px 24px rgba(0,0,0,.4);
}

/* mobile: stack */
@media (max-width: 900px) {
  .about-split { grid-template-columns: 1fr; }
  .about-image { text-align: center; margin-top: 1.5rem; }
  .about-image img { width: 60%; }
}

/* darkest "Chat with my Experience" button - no border */
#openChatBtn {
  background: #0d0d0d !important;   /* pure black */
  border: none !important;
  box-shadow: none !important;
}

/* --------------------------------------------------
   Masonry Grid – Featured Articles
-------------------------------------------------- */
.masonry-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  grid-auto-flow: dense;
}

/* 2 × 2 hero card */
.masonry-hero{
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}
.masonry-hero .masonry-thumb{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.masonry-hero .card-icon{
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  padding: .5rem .75rem;
  border-radius: 8px;
  font-size: 1.2rem;
}
.masonry-hero .card-body{
  padding: 1.2rem 1.5rem 0;
  flex: 1;
}
.masonry-hero h3{
  font-size: 1.35rem;
  margin: .25rem 0 .5rem;
}
.masonry-hero p{
  font-size: 1rem;
  margin-bottom: .75rem;
}
.masonry-hero .card-actions{
  padding: 0 1.5rem 1.5rem;
}

/* smaller cards */
.masonry-small{
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.masonry-small h3{
  font-size: 1rem;
  margin: .2rem 0 .4rem;
}
.masonry-small p{
  font-size: .9rem;
}

/* editorial hover accent */
.masonry-grid > .card{
  transition: transform .22s, box-shadow .22s, border-color .22s;
  border: 2px solid transparent;
}
.masonry-grid > .card:hover{
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 34px rgba(255,107,0,.12);
}

/* centre the “Explore Blog” button */
.articles-cta{
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* ---------- mobile: collapse to single column ---------- */
@media (max-width: 720px){
  .masonry-hero{
    grid-column: span 1;
    grid-row: span 1;
  }
  .masonry-grid{
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------
   1.  Whole card is clickable
-------------------------------------------------- */
a.card-link{
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color .22s, transform .22s;
}
a.card-link:hover{
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* --------------------------------------------------
   2.  Hero card – smaller title + subtitle + bottom-left
-------------------------------------------------- */
.masonry-hero{
  position: relative;
  grid-column: span 2;
  grid-row: span 2;
  padding: 0;
  overflow: hidden;
  justify-content: flex-end;   /* push content to bottom */
}
.masonry-hero-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.masonry-hero-overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 50%, transparent 100%);
}
.masonry-hero-bottom{
  position: relative;
  z-index: 2;
  padding: 2rem;
  text-align: left;
}
.masonry-hero-title{
  font-size: 1.25rem;              /* smaller than before */
  margin: 0 0 .25rem;
}
.masonry-hero-sub{
  font-size: .95rem;
  opacity: .9;
  margin: 0;
}

/* --------------------------------------------------
   3.  Small cards – image below text + no reading time
-------------------------------------------------- */
.masonry-small{
  padding: 0;
  overflow: hidden;
}
.masonry-small-top{
  padding: 1rem;
  flex: 1;
}
.masonry-small-img{
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

/* random heights & widths (same prime patterns) */
.masonry-small:nth-child(3n)   { grid-row: span 2; }
.masonry-small:nth-child(5n+2) { grid-row: span 1; }
.masonry-small:nth-child(7n+4) { grid-row: span 2; }

@media (min-width: 721px){
  .masonry-small:nth-child(11n)  { grid-column: span 2; }
  .masonry-small:nth-child(13n+6){ grid-column: span 1; }
  .masonry-small:nth-child(17n+9){ grid-column: span 2; }
}

/* mobile: single column */
@media (max-width: 720px){
  .masonry-hero{ grid-column: span 1; grid-row: span 1; }
  .masonry-grid{ grid-template-columns: 1fr; }
}

/* dark-grey small cards */
.masonry-small{ background: #1c1c1c; }

/* ---------- Featured Solutions – 25 % shorter, layout untouched ---------- */
#portfolio .card{
  padding: .55rem;                    /* was 1 rem */
  font-size: .85rem;                  /* was ~.95 rem */
}
#portfolio .card-body{
  padding: .4rem 0;                   /* tighter vertical spacing */
}
#portfolio .card-actions{
  padding-top: .4rem;                 /* bring button closer */
}
#portfolio .card-body h3{
  font-size: .95rem;                  /* slightly smaller title */
}
#portfolio .card-fill-img{            /* optional thumb inside card */
  max-height: 90px;                   /* keep image visible */
  object-fit: cover;
}

/* ---------- Big cards (left column) – show full image ---------- */
#portfolio .big-cards .card-fill-img{
  max-height: 190px;     /* was 140 px → now fits 25 % shorter card */
  object-fit: cover;
  width: 100%;
  border-radius: 6px;
}

/* Services grid: responsive columns + card sizing */
.services-grid {
  display: grid;
  gap: 1.25rem; /* space between cards */
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

/* responsive breakpoints */
@media (max-width: 1050px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .services-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ensure cards occupy same height and don't shrink */
.services-grid .card {
  display: block;
  height: 320px;          /* consistent card height — adjust as needed */
  min-height: 280px;
  box-sizing: border-box;
  position: relative;
}



/* small visual tuning so icons & text don't wrap oddly */
.services-grid .card-front .card-icon { font-size: 1.4rem; margin-bottom: 0.45rem; }
.services-grid .card-front .card-body h3 { margin: 0 0 .35rem; line-height: 1.1; }


/* ================= Services: equal-height cards, centered pill buttons, denser faded grid ================= */

/* 1) Ensure the services cards area stretches so actions align horizontally across each row */
#services .cards {
  display: grid; /* keep your responsive setup */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  grid-auto-rows: 1fr;         /* make rows equal-height */
  align-items: stretch;       /* force cards to stretch to the row height */
}

/* Make each card fill its grid cell so bottom actions align */
#services .cards .card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;    /* critical so every card has same height in row */
  min-height: 320px !important; /* keep a comfortable default; tweak if needed */
  padding: 1.05rem !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

/* let the body grow so actions remain at the bottom of the card */
#services .cards .card .card-body {
  flex: 1 1 auto !important;
  display: block !important;
  margin-bottom: 0.6rem !important;
  overflow-wrap: break-word !important;
}

/* center actions horizontally and allow wrap on small screens */
#services .cards .card .card-actions {
  display: flex !important;
  justify-content: center !important;  /* center horizontally */
  gap: .75rem !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  z-index: 4 !important; /* above overlay */
  padding-top: .45rem !important;
}

/* Keep both buttons the same pill width/shape and avoid overflow */
#services .cards .card .card-actions > * {
  flex: 0 1 46% !important;    /* two buttons side-by-side on desktop */
  min-width: 120px !important;
  max-width: 46% !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* small screens: stack and take full width */
@media (max-width: 560px) {
  #services .cards .card .card-actions > * {
    flex: 0 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  #services .cards .card { min-height: unset !important; }
}

/* 2) Unified pill button visual (shape like "View Case Study") but dark background + hero orange text */
/* Hero orange: #ff6b00 (used for stronger consistency with head) */
#services .cards .card .card-actions .cta-secondary,
#services .cards .card .card-actions .service-btn,
#services .cards .card .card-actions a.service-learn,
#services .cards .card .card-actions button.service-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .4rem !important;
  padding: 9px 14px !important;
  border-radius: 999px !important;          /* exact pill shape as .cta-secondary */
  border: 1px solid rgba(255,255,255,0.04) !important;
  background: linear-gradient(180deg, #2f2f2f 0%, #232323 100%) !important; /* dark grey pill */
  color: #ff6b00 !important;                /* hero orange */
  font-weight: 700 !important;
  font-size: .95rem !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.38) !important;
  z-index: 5 !important; /* ensure it sits above the grid overlay */
  transition: transform .18s ease, box-shadow .18s ease, opacity .12s ease !important;
}

/* hover / active */
#services .cards .card .card-actions .cta-secondary:hover,
#services .cards .card .card-actions .service-btn:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 18px 40px rgba(0,0,0,0.48) !important;
  background: linear-gradient(180deg, #383838 0%, #2a2a2a 100%) !important;
  opacity: 1 !important;
}

/* focus outline for accessibility */
#services .cards .card .card-actions .cta-secondary:focus,
#services .cards .card .card-actions .service-btn:focus {
  outline: 3px solid rgba(255,107,0,0.14);
  outline-offset: 2px;
}

/* 3) Denser, brighter grid overlay — fade top→bottom to match hero visuals */
/* overlay pseudo placed underneath content (content z-index is > overlay) */
#services .cards .card::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;    /* below content (content is z-index 4/5 above) */
  pointer-events: none !important;
  border-radius: inherit !important;
  background-repeat: repeat !important;
  mix-blend-mode: screen !important;
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.9,.25,1) !important;
  opacity: 0.48 !important;
  /* denser orange + faint blue cross-grid + subtle darker tiles */
  background-image:
    /* orange vertical lines (dense) */
    repeating-linear-gradient(90deg, rgba(255,107,0,0.26) 0 1px, transparent 1px calc(16px)),
    /* orange horizontal lines */
    repeating-linear-gradient(0deg,  rgba(255,107,0,0.22) 0 1px, transparent 1px calc(16px)),
    /* blue accent grid (subtle) */
    repeating-linear-gradient(90deg, rgba(95,211,255,0.035) 0 1px, transparent 1px calc(8px)),
    repeating-linear-gradient(0deg,  rgba(95,211,255,0.03) 0 1px, transparent 1px calc(8px)),
    /* subtle soft tile fill to darken some cells a bit (very soft) */
    linear-gradient(45deg, rgba(0,0,0,0.18) 0 12.5%, transparent 12.5% 37.5%, rgba(0,0,0,0.18) 37.5% 50%, transparent 50% 87.5%, rgba(0,0,0,0.18) 87.5% 100%);
  background-size: auto, auto, auto, auto, 32px 32px !important;
  /* Fade mask: stronger at top, softer at bottom */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.12) 75%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.12) 75%, rgba(0,0,0,0) 100%);
}

/* keep small-dot texture subtle (before pseudo) */
#services .cards .card::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  border-radius: inherit !important;
  pointer-events: none !important;
  background-image: radial-gradient(circle at 6px 6px, rgba(255,255,255,0.03) 0 1px, transparent 1px);
  background-size: 16px 16px !important;
  opacity: 0.08 !important;
  mix-blend-mode: screen !important;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0) 100%);
}

/* hover/focus: slightly stronger grid */
#services .cards .card:hover::after,
#services .cards .card:focus-within::after {
  opacity: 0.72 !important;
  transform: translateY(-6px) !important;
}
#services .cards .card:hover::before,
#services .cards .card:focus-within::before {
  opacity: 0.14 !important;
}

/* Reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  #services .cards .card::after,
  #services .cards .card::before,
  #services .cards .card .card-actions .cta-secondary,
  #services .cards .card .card-actions .service-btn {
    transition: none !important;
    transform: none !important;
  }
}

/* -------------------- Pull buttons up slightly -------------------- */
/* Reduce spacing below the text and pull the actions up a bit */
#services .cards .card .card-body {
  margin-bottom: 0.25rem !important;   /* closer to actions */
}
#services .cards .card .card-actions {
  padding-top: 0.12rem !important;
  margin-top: -6px !important;         /* pulls buttons up toward the text */
}

/* If you prefer a subtler lift, use margin-top: -3px instead */

/* -------------------- Make blue grid lines bolder & thicker -------------------- */
/* Override the ::after background to increase blue line opacity/thickness and overall contrast */
#services .cards .card::after {
  /* keep orange lines as before, but make blue layers thicker/stronger */
  background-image:
    /* orange vertical (dense) */
    repeating-linear-gradient(90deg, rgba(255,107,0,0.26) 0 1px, transparent 1px calc(16px)),
    /* orange horizontal */
    repeating-linear-gradient(0deg,  rgba(255,107,0,0.22) 0 1px, transparent 1px calc(16px)),
    /* stronger blue vertical — thicker 2px strokes, closer spacing for more presence */
    repeating-linear-gradient(90deg, rgba(95,211,255,0.14) 0 2px, transparent 2px calc(10px)),
    /* stronger blue horizontal */
    repeating-linear-gradient(0deg,  rgba(95,211,255,0.12) 0 2px, transparent 2px calc(10px)),
    /* subtle tile fill (unchanged) */
    linear-gradient(45deg, rgba(0,0,0,0.18) 0 12.5%, transparent 12.5% 37.5%, rgba(0,0,0,0.18) 37.5% 50%, transparent 50% 87.5%, rgba(0,0,0,0.18) 87.5% 100%);
  /* sizes — keep tile fairly small */
  background-size: auto, auto, auto, auto, 32px 32px !important;
  /* raise overall overlay contrast a touch so lines show well on the card bg */
  opacity: 0.60 !important;
  /* keep the top->bottom fade mask */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.12) 75%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.12) 75%, rgba(0,0,0,0) 100%);
}

/* Slightly emphasize the blue dot texture as well (optional) */
#services .cards .card::before {
  background-image: radial-gradient(circle at 6px 6px, rgba(255,255,255,0.035) 0 1px, transparent 1px);
  opacity: 0.10 !important;
}

/* ====== Services: taller cards, slightly smaller body text, buttons pulled up ====== */

/* Make cards taller on desktop/tablet for more breathing room */
#services .cards {
  /* keep auto-fit responsive columns, only change row sizing via min-height on card */
  grid-auto-rows: 1fr !important;
}

/* Increase the minimum card height (desktop/tablet) */
#services .cards .card {
  min-height: 420px !important;    /* ↑ increase this to 440px if you want even taller cards */
  padding: 1.1rem !important;
  height: 100% !important;         /* ensures equal row height behavior */
  box-sizing: border-box !important;
}

/* Slightly reduce the paragraph/body text inside cards (not titles) */
#services .cards .card .card-body p,
#services .cards .card .card-body > p {
  font-size: 0.92rem !important;    /* slightly smaller; change to 0.88rem if you want smaller */
  line-height: 1.45 !important;
  margin-bottom: 0.12rem !important; /* less space below text so buttons are closer */
  color: inherit !important;
}

/* Reduce bottom gap from body to actions so buttons move up */
#services .cards .card .card-body {
  margin-bottom: 0.12rem !important;  /* was 0.25 / 0.6 previously — now much closer */
  padding-bottom: 0 !important;
}

/* Pull the action row further up (closer to the body) */
#services .cards .card .card-actions {
  margin-top: -12px !important;      /* pulls buttons up; adjust -8px / -16px to taste */
  padding-top: 0 !important;
}

/* Keep button sizing consistent after moving them */
#services .cards .card .card-actions > * {
  min-width: 120px !important;
  max-width: 46% !important;
  box-sizing: border-box !important;
}

/* Mobile: keep cards comfortable but not too tall; buttons stack */
@media (max-width: 720px) {
  #services .cards .card {
    min-height: 300px !important;    /* mobile friendly */
    padding: 0.9rem !important;
  }
  #services .cards .card .card-actions {
    margin-top: 6px !important;      /* undo heavy negative margin for stacked layout */
    flex-wrap: wrap !important;
    gap: .5rem !important;
  }
  #services .cards .card .card-actions > * {
    flex: 0 1 100% !important;
    max-width: 100% !important;
  }
  #services .cards .card .card-body p {
    font-size: 0.95rem !important;   /* slightly larger on small screens for readability */
  }
}

/* reduced-motion safety */
@media (prefers-reduced-motion: reduce) {
  #services .cards .card,
  #services .cards .card .card-actions,
  #services .cards .card .card-body {
    transition: none !important;
  }
}

/* ====== Services : move buttons UP without absolute ====== */
#services .cards .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    padding: 1.05rem;
}

/* 1.  remove the “spring” that pushes actions down */
#services .cards .card .card-body {
    flex: 0 0 auto;          /* ← kill flex:1 */
    margin-bottom: 0.4rem;   /* small gap → buttons */
    padding-bottom: 0;
}

/* 2.  actions now sit directly under the text */
#services .cards .card .card-actions {
    margin-top: 0;           /* ← remove previous -20px hack */
    padding-top: 0;
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* 3.  slimmer, shorter buttons */
#services .cards .card-actions .cta-secondary,
#services .cards .card-actions .service-btn {
    font-weight: 500;                /* lighter text */
    font-size: .9rem;
    padding: 7px 12px;               /* smaller pill */
    border-radius: 999px;
    background: linear-gradient(180deg,#2f2f2f 0%,#232323 100%);
    color: #ff6b00;
    border: 1px solid rgba(255,255,255,.04);
    transition: transform .18s, box-shadow .18s;
    flex: 0 1 auto;
    min-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 560px) {
    #services .cards .card-actions > * { min-width: 100%; }
}

/* ===== Services : whole card is the link ===== */
#services .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

#services .card.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 320px;
  padding: 1.1rem;
  background: rgba(25,25,25,.82);
  border: 2px solid transparent;
  border-radius: 12px;
  text-decoration: none;   /* kill link underline */
  color: inherit;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}

#services .card.service-card:hover,
#services .card.service-card:focus-within {
  transform: translateY(-4px);
  border-color: #ff6b00;
  box-shadow: 0 18px 34px rgba(255,107,0,.12);
}

#services .card.service-card .card-icon {
  font-size: 1.3rem;
  color: #ff6b00;
  margin-bottom: .6rem;
}

#services .card.service-card .card-body {
  flex: 1 1 auto;
}

#services .card.service-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: .2rem 0 .4rem;
  color: #fff;
}

#services .card.service-card p {
  font-size: .92rem;
  line-height: 1.45;
  color: #dbe7ef;
  margin: 0;
}

/* accessibility focus outline */
#services .card.service-card:focus {
  outline: 3px solid rgba(255,107,0,.15);
  outline-offset: 2px;
}

/* mobile safety */
@media (max-width: 720px) {
  #services .card.service-card {
    min-height: 280px;
  }
}
/* ===== Services : fade starts higher (under text) ===== */
#services .cards .card::after {
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1)  0%,
    rgba(0,0,0,1)  10%,   /* ← fully visible until mid-card */
    rgba(0,0,0,.6) 20%,   /* ← fade STARTS here (under text) */
    rgba(0,0,0,0)  90%    /* ← fully gone well before bottom */
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1)  0%,
    rgba(0,0,0,1)  10%,
    rgba(0,0,0,.6) 20%,
    rgba(0,0,0,0)  90%
  );
}

/* ===== Services : hide top icons ===== */
#services .cards .card .card-icon {
  display: none;
}
/* ===== Services : bigger & white text ===== */
#services .cards .service-card .card-body h3 {
  font-size: 1.35rem !important;   /* title */
  line-height: 1.2 !important;
  color: #fff !important;
}

#services .cards .service-card .card-body p {
  font-size: 1.05rem !important;   /* paragraph */
  line-height: 1.55 !important;
  color: #fff !important;          /* pure white */
  margin-top: .6rem !important;
}

/* mobile */
@media (max-width: 720px) {
  #services .cards .service-card .card-body h3 { font-size: 1.2rem !important; }
  #services .cards .service-card .card-body p  { font-size: .98rem !important; }
}

/* ===== Services : final gap tweak ===== */
#services .cards .service-card .card-body h3 {
  margin-bottom: 3rem !important;   /* even bigger gap – tweak px */
}

#services .cards .service-card .card-body p {
  margin-top: 0 !important;           /* ensure no browser default */
}

/* ===== Services : bottom “Learn more” pill ===== */
#services .cards .service-card .card-actions {
  margin-top: auto;          /* push to bottom */
  padding-top: .8rem;
  text-align: center;
}

#services .cards .service-card .cta-secondary {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.04);
  background: transparent;
  color: var(--muted-2);
  font-size: .9rem;
  font-weight: 500;
  transition: all .22s;
}

#services .cards .service-card:hover .cta-secondary {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ===== Services : pull “Learn more” buttons UP ===== */
#services .cards .service-card .card-actions {
  margin-top: -12px !important;   /* ↑ tweak -8px … -20px to taste */
  padding-top: 0 !important;
}

/* ===== Services : body text → light grey ===== */
#services .cards .service-card .card-body p {
  color: #b8b8b8 !important;   /* soft light grey – tweak to taste */
}

/* ===== Services : button font & colour override ===== */
#services .cards .service-card .card-actions .cta-secondary {
  font-weight: 400 !important;
  color: #b8b8b8 !important;
}

/* ==========  TECH STACK  ========== */
#tech-stack {
  padding: 4rem 0 3rem;
}

#tech-stack .section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .5px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax 90px, 1fr));
  gap: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: .6rem;
  background: rgba(255, 255, 255, .04);
  border-radius: 8px;
  transition: transform .22s, background .22s;
  filter: brightness(.92) saturate(.9);
}

.logo-grid img:hover {
  transform: translateY(-3px);
  background: rgba(255, 107, 0, .08);
  filter: brightness(1) saturate(1);
}

@media (prefers-reduced-motion: reduce) {
  .logo-grid img {
    transition: none;
  }
}

@media (max-width: 600px) {
  .logo-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: .8rem;
  }
}

/* ===== Tech-Stack : force small grid ===== */
.logo-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)) !important;
  gap: .8rem !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo-grid img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  max-width: 48px !important;   /* lock icon size */
  margin: 0 auto;               /* centre in cell */
}

/* ===== Services : tighten bottom spacing ===== */
#services {
  padding-bottom: 2rem !important;   /* default was ~4rem – lower as needed */
}

/* 1.  kill the placeholder spacer completely */
#services .placeholder {
  display: none !important;
}

/* 2.  if logo-wall lives inside services, clamp its bottom margin */
#services .logo-wall {
  margin-bottom: 0 !important;
  padding-bottom: 1rem !important;   /* keep a small air-gap only */
}

/* 3.  final bottom padding of the section itself */
#services.section {
  padding-bottom: 3rem !important;   /* tweak 1–2 rem to taste */
}

/* ===== Contact : bigger social icons ===== */
#contact .socials a {
  font-size: 1.6rem !important;   /* default was ~1.2rem – adjust px/rem */
  width: 44px;                    /* optional hit-area enlargement */
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Tech-Stack : lighter idle + white hover ===== */
.logo-grid img {
  background: rgba(255, 255, 255, .08) !important; /* ← lighter idle */
  transition: background .22s, transform .22s, filter .22s;
}

.logo-grid img:hover {
  background: #ffffff !important; /* clean white on hover */
  filter: brightness(1.05) drop-shadow(0 0 6px rgba(255, 107, 0, .35));
  transform: translateY(-3px);
}

/* ===== Tech-Stack : centre last row ===== */
.logo-grid {
  justify-content: center;   /* centres incomplete row */
}

/* ===== Featured Solutions : tight grey grid ===== */
#portfolio .cards .card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(45,45,45,.30) 0 1px, transparent 5px 1px),
    repeating-linear-gradient(0deg,  rgba(45,45,45,.30) 0 1px, transparent 5px 1px);
}

/* --- force grid to stay visible --- */
#portfolio .cards .card {
  position: relative;          /* ensure stacking context */
  z-index: 0;                  /* card itself */
  background: rgba(25,25,25,.82);
}

#portfolio .cards .card::after {
  z-index: -1;                 /* grid sits *between* page and card */
}

/* ===== Featured Solutions : small / normal-weight / grey text ===== */
#portfolio .cards .card-actions .cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.04);
  background: linear-gradient(180deg,#2f2f2f 0%,#232323 100%);
  color: #b8b8b8;          /* muted grey */
  font-weight: 400;         /* normal weight */
  font-size: .8rem;         /* slightly smaller */
  transition: transform .18s, box-shadow .18s, background .18s;
}

#portfolio .cards .card-actions .cta-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.48);
  background: linear-gradient(180deg,#383838 0%,#2a2a2a 100%);
  color: #b8b8b8;           /* keep grey on hover */
}

/* ===== Featured Solutions : lift button row ===== */
#portfolio .cards .card-actions {
  margin-top: -10px;   /* ← tweak -8px … -14px to taste */
  padding-top: 0;
}

/* ===== Featured Solutions : tighter title → subtitle ===== */
#portfolio .cards .card-body h3 {
  margin-bottom: .2rem;   /* was ~0.5 rem – now snug */
}

#portfolio .cards .card-body p {
  margin-top: 0;          /* remove any browser default top margin */
}

/* ===== Featured Solutions : smaller body text ===== */
#portfolio .cards .card-body p {
  font-size: .8rem;      /* was ~.95 rem – adjust if you need even smaller */
  line-height: 1.4;      /* optional: keep it readable */
}




/* === Fix: nicer spacing for big (left) portfolio cards === */
.portfolio-grid .big-cards .card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;            /* space between title/paras, actions and image */
  align-items: stretch;
}

/* undo the negative pull and ensure comfortable spacing */
.portfolio-grid .big-cards .card .card-actions {
  margin-top: 0 !important;   /* override the earlier negative margin (was -10px). */
  padding-top: 0 !important;
  margin-bottom: 0.25rem;     /* small breathing room above the image */
  justify-content: center;    /* keep button centered */
}

/* slightly increase space between actions and the image */
.portfolio-grid .big-cards .card .card-fill-img {
  margin-top: 1rem !important;
  max-height: 180px;          /* keep image size controlled */
  object-fit: cover;
}

/* === Align & "pull up" View Case Study buttons on small (right) cards ===
   - Makes .card-body a vertical flex container with consistent gaps
   - Forces .card-actions to appear before the image (visual reorder)
   - Keeps consistent spacing across big and small cards
*/
.portfolio-grid .card .card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;              /* space between title/desc, actions, image */
}

/* visually place actions before the image so buttons sit higher */
.portfolio-grid .card .card-actions {
  order: 2;                 /* appear before image */
  margin-top: 0 !important; /* override any negative pulls */
  margin-bottom: 0.25rem;
  justify-content: center;  /* keep button centered */
  align-self: center;       /* center horizontally on small cards */
}




/* image goes after actions visually, keeping it a bit separated */
.portfolio-grid .card .card-fill-img {
  order: 3;
  margin-top: 0.5rem !important;
  max-height: 160px;
  object-fit: cover;
}

/* ensure each card stretches equally so rows look aligned */
.portfolio-grid { 
  display: grid; 
  grid-auto-rows: 1fr;
}

/* card as column so footer/actions positioning is stable */
.portfolio-grid .card {
  display: flex;
  flex-direction: column;
}

/* keep card body flexible so actions sit where we want */
.portfolio-grid .card .card-body {
  flex: 1 1 auto;
}

/* small-card specific tweaks (right column) to make buttons slightly more compact */
.portfolio-grid .small-cards .card .card-actions a,
.portfolio-grid .card .card-actions a {
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 999px; /* pill look */
}

/* >>> PATCH: Uniform card layout for #portfolio — put at END of style.css <<< */
#portfolio .cards {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 1.25rem;
}

/* make each card a column so we can align actions consistently */
#portfolio .cards .card {
  display: flex !important;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}

/* make card-body expand so actions sit consistently */
#portfolio .cards .card .card-body {
  display: flex !important;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
}

/* >>> PATCH: pull up "Learn more" buttons for Services & Packages (place at EOF) <<< */

/* make each service/package card a vertical flex column so spacing is predictable */
#services .cards,
#packages .cards {
  display: grid;         /* keep your grid layout */
  gap: 1.0rem;
  /* keep layout as-is — we only change internal card flow below */
}

/* make each card a column so body and actions stack predictably */
#services .cards .card,
#packages .cards .card {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

/* tighten the card-body spacing so actions sit closer to the content */
#services .cards .card .card-body,
#packages .cards .card .card-body {
  padding-top: 0.45rem;
  padding-bottom: 0.25rem;
  line-height: 1.25;
  text-align: center;
}

/* pull up the Learn more / CTA so it sits nearer the body (not too close) */
#services .cards .card .card-actions,
#packages .cards .card .card-actions {
  margin-top: -6px !important;     /* visually lifts the button */
  padding-top: 0 !important;       /* cancel any extra top padding */
  align-self: center;
  order: 2;
}

/* make sure the CTA pill stays compact and consistent */
#services .cards .card .card-actions .cta-secondary,
#packages .cards .card .card-actions .cta-secondary {
  padding: 0.4rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 999px;
}

/* small screens: remove the negative lift so nothing overlaps on mobile */
@media (max-width: 720px) {
  #services .cards .card .card-actions,
  #packages .cards .card .card-actions {
    margin-top: 0 !important;
    padding-top: .45rem !important;
  }
}
/* make the services/packages grid use equal-height rows so vertical alignment works */
#services .cards,
#packages .cards {
  display: grid !important;
  grid-auto-rows: 1fr !important;
  gap: 1rem !important;
}

/* treat each card as a vertical flex container */
#services .cards .card,
#packages .cards .card,
#services .cards a.card,
#packages .cards a.card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* make the card body take available space so actions can sit where we want */
#services .cards .card .card-body,
#packages .cards .card .card-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
  flex: 1 1 auto !important;
  align-items: stretch !important;
  text-align: center !important;
}

/* STRONG override: pull actions visually up, keep them centered */
#services .cards .card .card-actions,
#packages .cards .card .card-actions {
  order: 2 !important;                   /* show before any image ordered later */
  margin-top: 0 !important;             /* cancel earlier negative margins */
  padding-top: 0 !important;
  align-self: center !important;
  z-index: 3 !important;
  transform: translateY(-8px) !important; /* modest visual pull-up */
  transition: transform .18s !important;
}

/* Make CTAs compact and consistent */
#services .cards .card .card-actions .cta-secondary,
#packages .cards .card .card-actions .cta-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.38rem 0.9rem !important;
  font-size: 0.95rem !important;
  border-radius: 999px !important;
}

/* Ensure any images in the card body come after the actions visually */
#services .cards .card .card-fill-img,
#packages .cards .card .card-fill-img,
#services .cards .card img,
#packages .cards .card img {
  order: 3 !important;
  margin-top: 0.6rem !important;
  max-height: 160px !important;
  width: 100% !important;
  object-fit: cover !important;
}

/* safeguard older generic .card-actions negative rule */
.card-actions { margin-top: 0 !important; }

/* MOBILE: remove transform so nothing overlaps on small screens */
@media (max-width: 720px) {
  #services .cards,
  #packages .cards {
    grid-auto-rows: auto !important;
  }
  #services .cards .card .card-actions,
  #packages .cards .card .card-actions {
    transform: none !important;
    margin-top: 0.4rem !important;
  }
}

/* ====== FIX: prevent Learn more buttons from overlapping text ======
   Paste this at the VERY END of style.css (after any previous overrides)
*/

/* 1) Reserve space inside each card so pulled-up CTA doesn't cover text */
#services .cards .card .card-body,
#packages .cards .card .card-body {
  padding-bottom: 1.15rem !important; /* space for the pulled-up button */
  min-height: 5.25rem !important;     /* prevents very-short cards from collapsing */
  box-sizing: border-box !important;
}

/* 2) Make the pull-up milder so it doesn't intrude */
#services .cards .card .card-actions,
#packages .cards .card .card-actions {
  transform: translateY(-6px) !important;  /* milder lift */
  margin-top: 0 !important;
  z-index: 3 !important;
}

/* 3) If a card has image or extra content below, ensure the image remains after actions */
#services .cards .card .card-fill-img,
#packages .cards .card .card-fill-img {
  order: 3 !important;
  margin-top: 0.55rem !important;
}

/* MOBILE: remove the lift and relax spacing to avoid overlap on small screens */
@media (max-width: 720px) {
  #services .cards .card .card-body,
  #packages .cards .card .card-body {
    padding-bottom: 0.9rem !important;
    min-height: 0 !important;
  }
  #services .cards .card .card-actions,
  #packages .cards .card .card-actions {
    transform: none !important;
    margin-top: 0.4rem !important;
  }
}

/* ===== FEATURED SOLUTIONS (small cards) — pull-up Learn/View buttons safely ===== */
/* Add this at the very end of style.css so it wins over older rules */

/* make portfolio rows equal height so vertical alignment works */
#portfolio .cards,
#portfolio .portfolio-grid {
  display: grid !important;
  grid-auto-rows: 1fr !important;
  gap: 1rem !important;
}

/* treat small cards as vertical flex containers so flow is predictable */
#portfolio .cards .small-cards .card,
#portfolio .cards .small-cards a.card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* Let card-body expand and reserve space at bottom for pulled button */
#portfolio .cards .small-cards .card .card-body,
#portfolio .cards .small-cards a.card .card-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
  flex: 1 1 auto !important;
  padding-bottom: 1.05rem !important;   /* reserve space so button won't overlap text */
  min-height: 4.5rem !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

/* Pull up the action button modestly and center it (won't overlap due to padding) */
#portfolio .cards .small-cards .card .card-actions,
#portfolio .cards .small-cards a.card .card-actions,
#portfolio .cards .small-cards .card-body > .card-actions {
  order: 2 !important;                   /* ensure actions appear before image visually */
  margin-top: 0 !important;              /* cancel older negative margins */
  padding-top: 0 !important;
  align-self: center !important;
  z-index: 3 !important;
  transform: translateY(-6px) !important; /* gentle lift */
  transition: transform .18s !important;
}

/* Keep images below actions and controlled size */
#portfolio .cards .small-cards .card .card-fill-img,
#portfolio .cards .small-cards .card img,
#portfolio .cards .small-cards a.card .card-fill-img {
  order: 3 !important;
  margin-top: 0.5rem !important;
  max-height: 140px !important;
  width: 100% !important;
  object-fit: cover !important;
}

/* Safety fallback for older global selector */
#portfolio .cards .card-actions { margin-top: 0 !important; }

/* MOBILE: remove visual lift to avoid any risk of overlap on small screens */
@media (max-width: 720px) {
  #portfolio .cards,
  #portfolio .portfolio-grid { grid-auto-rows: auto !important; }
  #portfolio .cards .small-cards .card .card-body { padding-bottom: 0.9rem !important; min-height: 0 !important; }
  #portfolio .cards .small-cards .card .card-actions,
  #portfolio .cards .small-cards a.card .card-actions { transform: none !important; margin-top: 0.4rem !important; }
}

/* =========================
   UX PATCH: hero border + button hover behavior
   Paste this at the very END of style.css
   ========================= */

/* 1) Remove orange border on hover for the Featured Article hero card only.
   Keep keyboard focus ring intact (only target mouse hover/active). */
a.card-link.masonry-hero:hover,
a.card-link.masonry-hero:active {
  border-color: transparent !important;   /* don't show orange border on hover */
}

/* If you want to also remove when pointer device is used (modern browsers),
   use the pointer media query (optional) */
/*
@media (pointer: fine) {
  a.card-link.masonry-hero:hover { border-color: transparent !important; }
}
*/

/* 2) Make portfolio (featured solutions) + services/packages CTAs
      - change only border color and inner text color on hover -> var(--accent)
      - keep the existing button background unchanged
      - remove any hover background/box-shadow unwanted by earlier rules
   High-specificity selectors + !important to override previous rules placed earlier. */

/* Targets: CTA buttons inside portfolio / services / packages card-actions */
#portfolio .cards .card .card-actions .cta-secondary,
#portfolio .cards .card .card-actions a.cta-secondary,
#portfolio .cards .card .card-actions a.service-btn,
#portfolio .cards .card .card-actions button.service-btn,
#services .cards .card .card-actions .cta-secondary,
#services .cards .card .card-actions a.cta-secondary,
#services .cards .card .card-actions a.service-btn,
#services .cards .card .card-actions button.service-btn,
#packages .cards .card .card-actions .cta-secondary,
#packages .cards .card .card-actions a.cta-secondary,
#packages .cards .card .card-actions a.service-btn,
#packages .cards .card .card-actions button.service-btn {
  /* ensure border exists so it can change color on hover */
  border: 1px solid rgba(255,255,255,0.04) !important;
  /* keep whatever normal background you have (don't let hover change it) */
  background: none !important;
  background-image: none !important;
  background-color: transparent !important;
  /* smooth color/border transition */
  transition: color .18s ease, border-color .18s ease !important;
}

/* Hover + keyboard focus: border + text color -> accent; background unchanged */
#portfolio .cards .card .card-actions .cta-secondary:hover,
#portfolio .cards .card .card-actions a.cta-secondary:hover,
#portfolio .cards .card .card-actions a.service-btn:hover,
#portfolio .cards .card .card-actions button.service-btn:hover,
#services .cards .card .card-actions .cta-secondary:hover,
#services .cards .card .card-actions a.cta-secondary:hover,
#services .cards .card .card-actions a.service-btn:hover,
#services .cards .card .card-actions button.service-btn:hover,
#packages .cards .card .card-actions .cta-secondary:hover,
#packages .cards .card .card-actions a.cta-secondary:hover,
#packages .cards .card .card-actions a.service-btn:hover,
#packages .cards .card .card-actions button.service-btn:hover,
#portfolio .cards .card .card-actions .cta-secondary:focus,
#portfolio .cards .card .card-actions a.cta-secondary:focus,
#services .cards .card .card-actions .cta-secondary:focus,
#services .cards .card .card-actions a.cta-secondary:focus,
#packages .cards .card .card-actions .cta-secondary:focus,
#packages .cards .card .card-actions a.cta-secondary:focus {
  color: var(--accent) !important;         /* inside text turns orange */
  border-color: var(--accent) !important;  /* border turns orange */
  /* explicitly neutralize any hover bg/box-shadow injected earlier in your file */
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  /* preserve any transform/translate if you prefer the lift effect */
  /* If you *do not* want the button to lift, uncomment the next line:
     transform: none !important;
  */
}

/* 3) Extra safety: remove hover background from generic .cta-secondary hover rules later in file
   (neutralize other conflicting definitions that may appear after this block) */
.cta-secondary:hover,
.card-actions .service-btn:hover,
.card-actions a.service-btn:hover,
button.service-btn:hover {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* 4) Small-screen safety: keep mobile spacing & no overlap */
@media (max-width: 720px) {
  /* ensure we don't remove focus styles for keyboard users */
  #portfolio .cards .card .card-actions .cta-secondary:focus,
  #services .cards .card .card-actions .cta-secondary:focus {
    outline: 2px solid rgba(255,107,0,0.12);
    outline-offset: 3px;
  }
}

/* ====== Remove orange hover line for Services cards only ======
   Paste at the very end of style.css
   Keeps keyboard focus (focus outline) untouched for accessibility.
*/

/* target the anchor/card elements inside #services and neutralize hover/active */
#services .cards a.card:hover,
#services .cards a.card:active,
#services .cards .card:hover,
#services .cards .card:active {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;        /* only for mouse hover/active */
  background-image: none !important;
}

/* if the orange line is applied via an inner pseudo-element, hide it on hover */
#services .cards a.card:hover::before,
#services .cards a.card:hover::after,
#services .cards .card:hover::before,
#services .cards .card:hover::after {
  display: none !important;
  opacity: 0 !important;
}

/* Safety: override any global hover rule that targets .card-link */
#services a.card-link:hover,
#services a.card-link:active {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Mobile & keyboard: ensure focus remains visible (don't remove focus ring) */
#services .cards a.card:focus,
#services .cards .card:focus,
#services a.card-link:focus {
  outline: 3px solid rgba(255,107,0,0.12); /* gentle accessible focus */
  outline-offset: 3px;
}

