/* =========================================================
   SECTIONS
   Styles for each page section, in document order.
   ========================================================= */

/* ---------- Display headings ----------
   .display sets the uppercase display style. Size modifiers come
   after it so they win the cascade. Each .display__line renders
   on its own line (used instead of <br>). */
.display {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.display__line {
  display: block;
}

.display--loose {
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.display--hero {
  font-size: clamp(40px, 7.4vw, 112px);
}

/* Hero phrases: only the one matching the chosen focus takes the accent
   ("Secure it." for Cyber & IT, "Design it." for Design & Web); the rest stay white. */
.hero-key {
  white-space: nowrap; /* keep "Secure it." together on narrow screens */
  transition: color 0.6s var(--ease);
}

html[data-mode='security'] .hero-key[data-key='security'],
html[data-mode='design'] .hero-key[data-key='design'] {
  color: var(--accent);
}

.display--about {
  font-size: clamp(40px, 7vw, 92px);
}

.display--contact {
  font-size: clamp(36px, 6vw, 82px);
}

.section-title {
  margin-bottom: 34px;
  font-size: clamp(28px, 4.6vw, 58px);
}

.section-title--sm {
  margin-bottom: 30px;
  font-size: clamp(28px, 4.4vw, 56px);
}

.section-title--lg {
  font-size: clamp(30px, 5vw, 66px);
}

.section-title--xl {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 70px);
}

/* ---------- Shared tile grid (1px hairline gaps) ---------- */
.tile-grid {
  display: grid;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-top: 80px;
}

.hero__lead {
  max-width: 640px;
  margin-top: 30px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.12em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--muted);
}

/* stretch: the focus switch matches the Hire me button's height */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
  margin-top: 40px;
}

/* Focus switch */
.mode-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 2px;
  font-family: var(--mono);
}

/* Same padding and type as .btn so it lines up with Hire me */
.mode-switch__btn {
  padding: 16px 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: inherit;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
}

.mode-switch__btn[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}

/* Compact copy of the switch that sits at the end of a section head */
.mode-switch--sm {
  order: 1;
}

.mode-switch--sm .mode-switch__btn {
  padding: 14px;
  font-size: 10px;
}

/* ---------- Statement ---------- */
.statement {
  max-width: 17ch;
  font-size: clamp(24px, 4.2vw, 54px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-transform: uppercase;
}

.statement__word {
  color: #2c2c30;
  transition: color 0.35s var(--ease);
}

.statement__word.is-lit {
  color: var(--text);
}

.statement__word.is-key {
  color: var(--accent);
}

/* ---------- Disciplines ---------- */
.discipline-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.discipline-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 28px 26px;
  background: var(--bg-card);
  transition: 0.3s;
}

.discipline-card:hover {
  background: var(--bg-card-hover);
}

.discipline-card__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.discipline-card__title {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.discipline-card__text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- Work ---------- */
.work-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.work-tile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 138px;
  padding: 26px;
  background: var(--bg-card);
  cursor: pointer;
  transition: 0.28s;
}

.work-tile:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.work-tile__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.work-tile__meta {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted);
}

.work-tile__arrow {
  color: var(--faint);
  transition: 0.25s;
}

.work-tile:hover .work-tile__arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ---------- Design gallery ---------- */
.gallery {
  margin-top: 60px;
}

.gallery__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-bottom: 22px;
}

.gallery__filter {
  padding: 14px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
}

.gallery__filter:hover {
  color: var(--text);
}

.gallery__filter[aria-pressed='true'] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.gallery__grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.gallery__item {
  background: var(--bg-card);
}

.gallery__item[hidden] {
  display: none;
}

.gallery__open {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  background: #f4f4f4;
  cursor: zoom-in;
}

.gallery__open img {
  width: 100%;
  height: auto;
  aspect-ratio: 25 / 16;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s var(--ease);
}

.gallery__open:hover img {
  transform: scale(1.04);
}

/* Badge on tiles that open a multi-image set */
.gallery__count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery__caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery__cat {
  color: var(--muted);
}

/* Lightbox (native <dialog>) */
.lightbox {
  max-width: min(1200px, 94vw);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--hair);
  background: var(--bg-raise);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}

.lightbox__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox__stage {
  position: relative;
}

.lightbox__img {
  max-height: calc(92vh - 58px);
  width: auto;
  margin: 0 auto;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: 0.2s;
}

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__nav:hover {
  background: var(--accent);
}

.lightbox__nav--prev {
  left: 12px;
}

.lightbox__nav--next {
  right: 12px;
}

/* ---------- Services ---------- */
.service {
  position: relative;
  overflow: hidden;
  margin-top: 1px;
  padding: 30px clamp(20px, 3vw, 40px);
  border: 1px solid var(--hair);
  background: var(--bg-card);
  transition: 0.3s;
}

.service:hover {
  background: var(--bg-card-hover);
}

.service__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.service__tag {
  letter-spacing: 0.2em;
  color: var(--accent);
}

.service__stack {
  letter-spacing: 0.12em;
  color: var(--muted);
}

.service__title {
  margin-top: 60px;
  font-size: clamp(25px, 3.4vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.service__text {
  max-width: 64ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- About ---------- */
.about__body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  margin-top: 40px;
}

.about__body p {
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.about__body p + p {
  margin-top: 20px;
}

.about__body strong {
  color: var(--text);
  font-weight: 500;
}

.role-list {
  display: flex;
  flex-direction: column;
}

.role-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
}

.role-item__num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.role-item__name {
  font-size: 15px;
}

.role-item__meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Stats ---------- */
/* Dividers are drawn per stat (like credentials) so an empty cell
   in the last row blends in instead of showing as a grey block */
.stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--bg-card);
}

/* <dt> comes first in the markup; column-reverse shows the value on top */
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 34px 20px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--hair);
  text-align: center;
}

.stat__value {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.45;
  color: var(--text);
}

.stat__label {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Credentials ---------- */
/* Dividers are drawn per card so empty cells in the last row blend in */
.cred-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 10px;
  background: var(--bg-card);
}

.cred {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--hair);
  transition: 0.28s;
}

.cred:hover {
  background: var(--bg-card-hover);
}

.cred__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hair);
  border-radius: 9px;
  color: var(--accent);
}

.cred__icon svg {
  width: 16px;
  height: 16px;
}

.cred__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cred__meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--muted);
}

.cred--pending .cred__icon {
  color: var(--muted);
}

/* ---------- FAQ ---------- */
.faq-item {
  border-top: 1px solid var(--hair);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--hair);
}

.faq-item__question {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 24px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
}

.faq-item__num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.faq-item__icon {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted);
  transition: 0.3s;
}

.faq-item.is-open .faq-item__icon {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 4px 0 40px;
  transition:
    max-height 0.4s var(--ease),
    padding 0.4s var(--ease);
}

.faq-item.is-open .faq-item__answer {
  max-height: 280px;
  padding: 0 4px 24px 40px;
}

.faq-item__answer p {
  max-width: 72ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-top: 40px;
}

.contact__lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.contact__email {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.contact__note {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: block;
  padding: 16px 18px;
  background: var(--bg-card);
}

.field:focus-within {
  box-shadow: inset 2px 0 0 var(--accent);
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px; /* below 16px, iOS Safari zooms the page on focus */
  resize: none;
}

/* Browser autofill paints the field white; keep it on the card colour. */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg-card) inset;
  filter: none;
  transition: background-color 9999s;
}

.field__input::placeholder {
  color: #44444a;
}

/* Honeypot field: hidden from people, filled in by spam bots. */
.contact-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Captcha and button share one cell, so a hidden captcha leaves no empty row. */
.contact-form__actions {
  grid-column: 1 / -1;
  display: grid;
  min-width: 0;
}

.contact-form__captcha {
  display: flex;
  justify-content: center;
  min-height: 89px; /* the widget's height plus padding, so nothing jumps while it loads */
  padding: 12px 0;
  background: var(--bg-card);
}

.contact-form__captcha.is-done {
  display: none;
}

.contact-form__submit {
  padding: 18px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
}

.contact-form__submit:hover {
  filter: brightness(1.08);
}

.contact-form__submit:disabled {
  cursor: wait;
  filter: brightness(0.8);
}

.contact-form__status {
  grid-column: 1 / -1;
  padding: 14px 18px;
  background: var(--bg-card);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.contact-form__status[data-state="success"] {
  box-shadow: inset 2px 0 0 var(--accent);
  color: var(--accent);
}

.contact-form__status[data-state="error"] {
  box-shadow: inset 2px 0 0 #ff5d5d;
  color: #ff8a8a;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about__body,
  .contact__grid,
  .contact-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  /* Size the hero to its content on phones instead of a full screen of empty space;
     the top padding clears the fixed menu button. */
  .hero {
    min-height: 0;
    padding-top: 96px;
  }
}
