/* =========================================================
   IFTEKHAR HYDER: components
   Header, hero, work showcase, AI flows, experience, contact,
   footer, case-study modal. Colours come only from base.css.
   ========================================================= */

/* ============ WORDMARK ============ */
.wordmark{
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--text);
}
.wordmark em{ font-style: italic; color: var(--auto); }

/* ============ HEADER ============ */
.site-header{
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 400ms var(--ease), border-color 400ms var(--ease),
              transform 500ms var(--ease);
}
.site-header.is-scrolled{
  background: rgb(var(--bg-rgb) / .88);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Slides away while reading down the page, back on any scroll up. */
.site-header.is-hidden{ transform: translateY(-100%); }

.nav-wrap{
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.nav-links{ display: flex; align-items: center; gap: clamp(1.2rem, 2.6vw, 2.4rem); }
.nav-links a{
  position: relative;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-dim);
  padding: .3em 0;
  transition: color 300ms var(--ease);
}
.nav-links a::after{
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--auto);
  transform: scaleX(0); transform-origin: right;
  transition: transform 400ms var(--ease);
}
.nav-links a:hover, .nav-links a.is-active{ color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after{ transform: scaleX(1); transform-origin: left; }

.nav-actions{ display: flex; align-items: center; gap: .5rem; }

.icon-btn{
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: transparent;
  transition: color 300ms var(--ease), border-color 300ms var(--ease);
}
.icon-btn svg{ width: 17px; height: 17px; }
.icon-btn:hover{ color: var(--text); border-color: var(--line-strong); }
.theme-toggle .i-sun{ display: none; }
[data-theme="dark"] .theme-toggle .i-sun{ display: block; }
[data-theme="dark"] .theme-toggle .i-moon{ display: none; }

.nav-toggle{
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45em;
  line-height: 0;
}
.nav-toggle svg{ width: 20px; height: 20px; }
.nav-toggle .icon-close{ display: none; }
.nav-toggle[aria-expanded="true"] .icon-open{ display: none; }
.nav-toggle[aria-expanded="true"] .icon-close{ display: block; }

@media (max-width: 860px){
  .nav-toggle{ display: inline-flex; position: relative; z-index: 95; }
  .nav-links{
    position: fixed; inset: 0; height: 100dvh; z-index: 90;
    background: var(--bg);
    flex-direction: column; justify-content: center; align-items: flex-start;
    gap: .6rem;
    padding: 6rem var(--gutter) 3rem;
    transform: translateY(-100%);
    transition: transform 560ms var(--ease);
  }
  .nav-links.open{ transform: none; }
  .nav-links a{ font-family: var(--font-display); font-size: 3rem; font-weight: 400; color: var(--text); }
  .wordmark, .nav-actions{ position: relative; z-index: 95; }
}
@media (max-width: 480px){
  .nav-actions .btn{ display: none; }
  .wordmark{ font-size: 1.5rem; }
}

/* ============ HERO ============ */
.hero{
  padding-top: calc(var(--header-h) + clamp(2rem, 6vw, 4.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.hero-grid{
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: minmax(0, 1fr); }
  .hero-portrait{ order: -1; max-width: 260px; justify-self: start; }
}

.hero-hello{
  display: inline-flex; align-items: center; gap: .6em;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
}
.dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: #2E9E5B;
  box-shadow: 0 0 0 4px rgb(46 158 91 / .18);
}
.hero-title{
  font-size: clamp(3rem, 1.6rem + 5.4vw, 6.4rem);
  line-height: .98;
  margin-bottom: .35em;
  max-width: 13ch;
}
.hero-sub{
  font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem);
  max-width: 44ch;
  margin-bottom: 2rem;
}
.hero-ctas{ display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2.4rem; }

/* ---- Profiles: labelled, so it's obvious where each one goes ---- */
.profiles{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem;
  max-width: 680px;
}
.profiles a{
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 300ms var(--ease), transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.profiles a > svg:first-child{ width: 22px; height: 22px; flex: none; color: var(--text); }
.profiles span{ display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.profiles b{ font-size: var(--step--1); }
.profiles small{
  font-size: var(--step--2);
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profiles a:hover{
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-tight);
}

/* ---- Portrait ---- */
.hero-portrait{
  position: relative;
  margin: 0;
  width: 100%;
  justify-self: center;
  aspect-ratio: 1;
}
.portrait-bg{
  position: absolute; inset: 8% 4% 0;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  background:
    radial-gradient(60% 50% at 30% 25%, rgb(var(--auto-rgb) / .35), transparent 70%),
    radial-gradient(55% 50% at 80% 80%, rgb(var(--web-rgb) / .25), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--line);
}
/* Studio headshot fills the same arch shape as the backdrop. */
.hero-portrait img{
  position: absolute; inset: 8% 4% 0;
  width: 92%; height: 92%;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.portrait-tag{
  position: absolute; left: -.5rem; bottom: 1.5rem;
  display: flex; flex-direction: column;
  padding: .7rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  line-height: 1.25;
}
.portrait-tag b{ font-size: var(--step--1); }
.portrait-tag span{ font-size: var(--step--2); color: var(--text-faint); }

/* ---- Brands strip ---- */
.brands{
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .6rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.brands-label{ font-size: var(--step--2); color: var(--text-faint); }
.brands ul{ display: flex; flex-wrap: wrap; gap: .3rem 1.8rem; }
.brands li{
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--text-dim);
}

/* ============ WORK ============ */
.work-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.2rem);
}
@media (max-width: 760px){ .work-grid{ grid-template-columns: 1fr; } }

.work-open{
  display: block; width: 100%;
  padding: 0; border: 0; background: none;
  text-align: left;
}
.work-media{
  position: relative;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 0;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  overflow: hidden;
  aspect-ratio: 16 / 11;
}
.work-card:nth-child(3n+2) .work-media{ background: rgb(var(--auto-rgb) / .1); }
.work-card:nth-child(3n) .work-media{ background: rgb(var(--web-rgb) / .1); }

/* Browser frame around each screenshot. */
.browser{
  position: relative;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding-top: 22px;
}
.browser > i{
  position: absolute; top: 8px; left: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgb(var(--text-rgb) / .2);
  box-shadow: 10px 0 0 rgb(var(--text-rgb) / .2), 20px 0 0 rgb(var(--text-rgb) / .2);
}
.browser img{ width: 100%; transition: transform 900ms var(--ease); }
/* Full-width screenshot at its natural ratio; the card crops the
   bottom, and the parallax slides it up inside the frame. */
.work-media .browser img{ width: 100%; height: auto; }
.work-open:hover .browser img{ transform: scale(1.03); }

.work-info{ padding: 1.1rem .2rem 0; }
.work-kind{ font-size: var(--step--2); color: var(--text-faint); margin: 0 0 .2rem; }
.work-info h3{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.05;
  margin: 0 0 .3rem;
}
.work-line{ font-size: var(--step--1); max-width: 46ch; margin-bottom: .6rem; }
.work-cta{
  display: inline-flex; align-items: center; gap: .4em;
  font-size: var(--step--1); font-weight: 600;
  color: var(--text);
  border-bottom: 1.5px solid var(--auto);
  padding-bottom: 2px;
}
.work-cta svg{ width: 14px; height: 14px; transition: transform 380ms var(--spring); }
.work-open:hover .work-cta svg{ transform: translateX(4px); }
.work-open:hover h3{ color: var(--auto); }
.work-info h3{ transition: color 300ms var(--ease); }

/* Featured card: full width, three versions fanned out. */
.work-card.is-feature{ grid-column: 1 / -1; }
.is-feature .work-open{
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2.5rem);
  align-items: end;
}
.is-feature .work-media{ aspect-ratio: 16 / 9.5; background: rgb(var(--auto-rgb) / .1); }
.is-feature .work-info{ padding-bottom: .5rem; }
.is-feature .work-info h3{ font-size: var(--step-3); }
.stack{ display: grid; }
.stack .browser{ grid-area: 1 / 1; height: auto; transition: transform 700ms var(--ease); }
.stack .browser img{ height: auto; }
.stack .b3{ transform: translate(-6%, 2%) rotate(-4deg) scale(.86); opacity: .75; }
.stack .b2{ transform: translate(6%, 4%) rotate(3deg) scale(.9); opacity: .85; }
.stack .b1{ transform: translateY(12%); }
.is-feature .work-open:hover .b3{ transform: translate(-12%, 0) rotate(-7deg) scale(.86); }
.is-feature .work-open:hover .b2{ transform: translate(12%, 2%) rotate(6deg) scale(.9); }
@media (max-width: 760px){
  .is-feature .work-open{ grid-template-columns: 1fr; }
}

/* ============ AI ============ */
.ai-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
}
@media (max-width: 980px){ .ai-grid{ grid-template-columns: 1fr; } }

.ai-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 2.6vw, 1.8rem);
  display: flex; flex-direction: column;
}
.ai-card h3{ margin-bottom: .4rem; }
.ai-card p{ font-size: var(--step--1); flex: 1; }

/* A tiny flow diagram, top to bottom, with a dot travelling down
   each connector. */
.flow{
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 1rem 1.1rem;
  margin-bottom: 1.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  min-height: 196px;
}
.flow .node{
  font-size: var(--step--2);
  font-weight: 600;
  padding: .4em .8em;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.flow .node.is-accent{ background: var(--auto); border-color: var(--auto); color: var(--on-auto); }
.flow i{
  position: relative;
  width: 1.5px; height: 16px;
  margin-left: 1.1rem;
  background: var(--line-strong);
}
.flow i::after{
  content: "";
  position: absolute; left: -2.5px; top: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--auto);
  animation: flowDot 1.8s var(--ease) infinite;
}
.flow i:nth-of-type(2)::after{ animation-delay: .6s; }
.flow i:nth-of-type(3)::after{ animation-delay: 1.2s; }
.flow i.both::after{ animation-direction: alternate; }
@keyframes flowDot{
  from{ top: 0; opacity: 0; }
  20%, 80%{ opacity: 1; }
  to{ top: calc(100% - 6px); opacity: 0; }
}

/* ============ EXPERIENCE + STACK ============ */
.exp-grid{
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 900px){ .exp-grid{ grid-template-columns: 1fr; } }

.jobs{ margin-top: 1.6rem; }
.jobs li{
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: .95rem 0;
  border-top: 1px solid var(--line);
}
.jobs li:last-child{ border-bottom: 1px solid var(--line); }
.when{ font-size: var(--step--2); color: var(--text-faint); padding-top: .2em; font-variant-numeric: tabular-nums; }
.what{ color: var(--text-dim); font-size: var(--step--1); }
.what b{ display: block; font-size: var(--step-0); color: var(--text); font-weight: 600; }
.edu{ margin-top: 1.2rem; font-size: var(--step--2); color: var(--text-faint); }

.stack h3{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-2);
  margin-bottom: 1.2rem;
}
.stack dl{
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  margin: 0;
}
.stack dt{ font-size: var(--step--2); color: var(--text-faint); padding-top: .4em; }
.stack dd{ margin: 0; }

/* ============ CONTACT ============ */
.contact{ background: var(--text); color: var(--bg); }
.contact h2, .contact b{ color: var(--bg); }
.contact h2 em{ color: rgb(var(--auto-rgb)); }
[data-theme="light"] .contact h2 em{ color: #FF8A5C; }
[data-theme="dark"] .contact h2 em{ color: #B4340E; }
.contact-title{ font-size: clamp(2.8rem, 1.6rem + 4.4vw, 5.6rem); max-width: 12ch; margin-bottom: .3em; }
.contact-sub{ color: rgb(var(--bg-rgb) / .75); font-size: var(--step-0); margin-bottom: 2rem; }

.contact-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 960px){ .contact-grid{ grid-template-columns: minmax(0, 1fr); } }

.contact-mail-row{
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem;
  margin-bottom: 2rem;
}
.contact-mail{
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 2vw, 2.4rem);
  line-height: 1.1;
  color: var(--bg);
  border-bottom: 2px solid rgb(var(--bg-rgb) / .3);
  padding-bottom: .15rem;
  transition: border-color 300ms var(--ease);
  overflow-wrap: anywhere;
}
.contact-mail svg{ width: .75em; height: .75em; flex: none; }
.contact-mail:hover{ border-color: var(--bg); }
.copy-btn{
  font-size: var(--step--2); font-weight: 600;
  color: var(--bg);
  background: transparent;
  border: 1px solid rgb(var(--bg-rgb) / .35);
  border-radius: 999px;
  padding: .45em 1em;
  transition: background 300ms var(--ease), color 300ms var(--ease);
}
.copy-btn:hover, .copy-btn.is-done{ background: var(--bg); color: var(--text); }

/* ---- Form, sitting on the inverted contact section ---- */
.contact-form{
  position: relative;
  isolation: isolate;
  overflow: visible;
  background:
    radial-gradient(80% 55% at 100% 0%, rgb(var(--auto-rgb) / .1), transparent 75%),
    linear-gradient(145deg, rgb(var(--bg-rgb) / .1), rgb(var(--bg-rgb) / .035));
  border: 1px solid rgb(var(--bg-rgb) / .2);
  border-radius: calc(var(--radius-lg) + 5px);
  padding: clamp(1.35rem, 3vw, 2.25rem);
  box-shadow: 0 30px 80px rgb(0 0 0 / .16);
  transition: border-color 280ms var(--ease), box-shadow 380ms var(--ease), transform 380ms var(--ease);
}
.contact-form::before{
  content: "";
  position: absolute;
  inset: 0 1.5rem auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--auto-rgb) / .7), transparent);
  pointer-events: none;
}
.contact-form:focus-within{
  border-color: rgb(var(--auto-rgb) / .48);
  box-shadow: 0 38px 90px rgb(0 0 0 / .2), 0 0 0 4px rgb(var(--auto-rgb) / .08);
  transform: translateY(-2px);
}
.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
@media (max-width: 520px){ .field-row{ grid-template-columns: 1fr; } }
.field{ position: relative; margin-bottom: 1.15rem; }
.field label{
  display: block;
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: .015em;
  color: rgb(var(--bg-rgb) / .82);
  margin-bottom: .48rem;
}
.field input, .field select, .field textarea{
  display: block;
  width: 100%;
  font: inherit;
  font-size: var(--step--1);
  color: var(--bg);
  background: rgb(var(--bg-rgb) / .065);
  border: 1px solid rgb(var(--bg-rgb) / .24);
  border-radius: 14px;
  padding: .82em 1em;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.field input, .field select{ min-height: 3.35rem; }
.field textarea{ resize: vertical; min-height: 160px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder{ color: rgb(var(--bg-rgb) / .52); }
.field input:hover, .field select:hover, .field textarea:hover, .select-trigger:hover{
  background: rgb(var(--bg-rgb) / .1);
  border-color: rgb(var(--bg-rgb) / .42);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .select-trigger:focus-visible{
  outline: 2px solid rgb(var(--auto-rgb) / .9);
  outline-offset: 2px;
  border-color: rgb(var(--auto-rgb) / .8);
  background: rgb(var(--bg-rgb) / .12);
  box-shadow: 0 8px 22px rgb(0 0 0 / .12);
  transform: translateY(-1px);
}
.field input:-webkit-autofill{
  -webkit-text-fill-color: var(--bg);
  -webkit-box-shadow: 0 0 0 1000px rgb(var(--bg-rgb) / .13) inset;
}
.subject-select{ position: relative; }
.subject-select > select{ appearance: auto; }
.select-trigger{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 3.35rem;
  padding: .82em 1em;
  color: var(--bg);
  text-align: left;
  background: rgb(var(--bg-rgb) / .065);
  border: 1px solid rgb(var(--bg-rgb) / .24);
  border-radius: 14px;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.select-trigger svg{ width: 1.1rem; height: 1.1rem; flex: none; transition: transform 280ms var(--ease); }
.select-trigger[aria-expanded="true"] svg{ transform: rotate(180deg); }
.select-menu{
  position: absolute;
  z-index: 20;
  inset: calc(100% + .5rem) 0 auto;
  display: grid;
  gap: .2rem;
  padding: .4rem;
  color: var(--bg);
  background: rgb(var(--text-rgb) / .98);
  border: 1px solid rgb(var(--bg-rgb) / .2);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgb(0 0 0 / .3);
  transform-origin: top center;
}
.select-menu:not([hidden]){ animation: select-menu-in 200ms var(--ease) both; }
.select-option{
  width: 100%;
  padding: .72rem .8rem;
  color: rgb(var(--bg-rgb) / .8);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: color 160ms ease, background 160ms ease, transform 160ms var(--ease);
}
.select-option:hover, .select-option:focus-visible, .select-option[aria-selected="true"]{
  color: var(--bg);
  background: rgb(var(--bg-rgb) / .12);
}
.select-option:focus-visible{ outline: 2px solid rgb(var(--auto-rgb) / .8); outline-offset: -2px; }
.field.has-error input, .field.has-error textarea, .field.has-error .select-trigger{ border-color: #FF8A7A; }
.hp{ position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn-send{
  position: relative;
  width: 100%;
  min-height: 3.5rem;
  background: var(--bg);
  color: var(--text);
  border-radius: 14px;
  margin-top: .2rem;
  box-shadow: 0 10px 24px rgb(0 0 0 / .12);
}
.btn-send:hover:not(:disabled){ background: rgb(var(--auto-rgb)); color: var(--on-auto); transform: translateY(-2px); box-shadow: 0 16px 30px rgb(0 0 0 / .2); }
[data-theme="dark"] .btn-send:hover{ background: #B4340E; color: #fff; }
.btn-send:disabled{ opacity: .78; cursor: progress; transform: none; }
.send-spinner{
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
.btn-send[aria-busy="true"] .send-spinner{ display: inline-block; animation: send-spin 700ms linear infinite; }
.btn-send[aria-busy="true"] svg{ display: none; }
.form-status{
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: .9rem 0 0;
  padding: .8rem .9rem;
  color: rgb(var(--bg-rgb) / .88);
  background: rgb(var(--bg-rgb) / .055);
  border: 1px solid rgb(var(--bg-rgb) / .14);
  border-radius: 12px;
  font-size: var(--step--1);
  line-height: 1.5;
  animation: status-in 240ms var(--ease) both;
}
.form-status:empty{ display: none; }
.form-status::before{ content: ""; flex: none; width: .55rem; height: .55rem; margin-top: .48em; border-radius: 50%; background: currentColor; }
.form-status.ok{ color: #7FD99A; background: rgb(127 217 154 / .08); border-color: rgb(127 217 154 / .2); }
.form-status.err{ color: #FF9A8A; background: rgb(255 154 138 / .08); border-color: rgb(255 154 138 / .2); }
[data-theme="dark"] .form-status.ok{ color: #1F7A3E; background: rgb(31 122 62 / .08); border-color: rgb(31 122 62 / .2); }
[data-theme="dark"] .form-status.err{ color: #B42318; background: rgb(180 35 24 / .08); border-color: rgb(180 35 24 / .2); }
@keyframes select-menu-in{ from{ opacity: 0; transform: translateY(-6px) scale(.98); } to{ opacity: 1; transform: none; } }
@keyframes send-spin{ to{ transform: rotate(360deg); } }
@keyframes status-in{ from{ opacity: 0; transform: translateY(5px); } to{ opacity: 1; transform: none; } }

.profiles-lg{ max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px){ .profiles-lg{ grid-template-columns: 1fr; } }
.profiles-lg a{
  background: rgb(var(--bg-rgb) / .06);
  border-color: rgb(var(--bg-rgb) / .18);
  padding: 1rem 1.1rem;
}
.profiles-lg a > svg:first-child{ color: var(--bg); width: 24px; height: 24px; }
.profiles-lg small{ color: rgb(var(--bg-rgb) / .65); }
.profiles-lg .arr{ width: 16px; height: 16px; margin-left: auto; flex: none; opacity: .6; transition: transform 400ms var(--spring), opacity 300ms; }
.profiles-lg a:hover{ border-color: var(--bg); box-shadow: none; }
.profiles-lg a:hover .arr{ transform: translate(3px, -3px); opacity: 1; }

/* ============ FOOTER ============ */
.site-footer{
  background: var(--text);
  color: rgb(var(--bg-rgb) / .65);
  border-top: 1px solid rgb(var(--bg-rgb) / .12);
}
.footer-row{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-block: 1.6rem;
}
.footer-row p{ margin: 0; font-size: var(--step--2); color: inherit; }
.site-footer .wordmark{ color: var(--bg); font-size: 1.5rem; }

/* ============ BACK TO TOP ============ */
.to-top{
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  opacity: 0; visibility: hidden;
  transform: translateY(14px);
  transition: opacity 380ms var(--ease), transform 380ms var(--spring), visibility 380ms;
}
.to-top svg{ width: 18px; height: 18px; }
.to-top.show{ opacity: 1; visibility: visible; transform: none; }

/* ============ CASE STUDY MODAL ============ */
.modal{
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: clamp(.8rem, 3vw, 2rem);
}
.modal-backdrop{
  position: absolute; inset: 0;
  background: rgb(var(--text-rgb) / .55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 360ms var(--ease);
}
.modal.open .modal-backdrop{ opacity: 1; }
.modal-panel{
  position: relative;
  width: min(880px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transition: opacity 380ms var(--ease), transform 520ms var(--ease);
}
.modal.open .modal-panel{ opacity: 1; transform: none; }
.modal-close{
  position: absolute; top: .9rem; right: .9rem; z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform 420ms var(--spring);
}
.modal-close svg{ width: 17px; height: 17px; }
.modal-close:hover{ transform: rotate(90deg); }
.modal-media{ border-radius: var(--radius-lg) var(--radius-lg) 0 0; border: 0; box-shadow: none; background: var(--bg-2); }
.modal-media img{ aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.modal-body{ padding: clamp(1.4rem, 4vw, 2.4rem); }
.modal-kind{ font-size: var(--step--2); color: var(--text-faint); margin-bottom: .3rem; }
.modal-panel h3{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1;
  margin-bottom: .5rem;
}
.modal-about{ font-size: var(--step-0); max-width: 60ch; }
.modal-body h4{ font-size: var(--step--1); margin: 1.4rem 0 .5rem; }
.modal-points li{
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: .35rem;
  color: var(--text-dim);
  font-size: var(--step--1);
}
.modal-points li::before{
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--auto);
}
.modal-tags{ margin: 1.2rem 0 1.4rem; }
.modal-links{ display: flex; flex-wrap: wrap; gap: .6rem; }
.modal-links svg{ width: 15px; height: 15px; }

/* Mobile: the name tag tucks into the portrait's lower-right corner.
   Declared last so it wins over the base .portrait-tag position. */
@media (max-width: 900px){
  .portrait-tag{ left: auto; right: -1.5rem; bottom: 1rem; padding: .5rem .8rem; }
}
