/* Hacken4U - site stylesheet. Hand-written; no framework or build step. */

/* ---------- Fonts (self-hosted, latin subset; see ../fonts/SOURCES.md) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900; /* variable font: used at 400, 500 and 600 */
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens (from the Remixer theme) ---------- */
:root {
  --color-background: #000000;
  --color-foreground: #FFFFFF;
  --color-primary: #F9FFBF;
  --color-primary-foreground: #000000;
  /* Bronze section background. The original #9A733E gave only 4.10:1 with
     primary text; #916C3A (same hue and saturation, 2.5% darker) gives 4.55:1. */
  --color-secondary: #916C3A;
  --color-muted: #868686;
  --color-muted-foreground: #9C9C9C;
  --color-card: #1a1a1a;
  --color-border: #868686;
  --color-border-soft: rgb(134 134 134 / 0.5);
  --color-primary-hover: rgb(249 255 191 / 0.9);
  --color-primary-tint: rgb(249 255 191 / 0.1);

  --font-heading: "Poppins", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;

  --radius-lg: 1rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-card: 0.75rem;

  /* The one vertical scale between content sections: top and bottom padding of
     every section (the page-top padding under the fixed header excepted). */
  --spacing-section: 2.25rem;   /* 3rem from 768px up */
  --spacing-container: 1rem;    /* 2rem from 768px up */
  --header-height: 4rem;        /* 5rem from 768px up */
}
@media (min-width: 768px) {
  :root {
    --spacing-section: 3rem;
    --spacing-container: 2rem;
    --header-height: 5rem;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-height);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, figure {
  margin: 0;
}
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
}
img, svg, picture {
  display: block;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button, input, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
main:focus {
  outline: none;
}

/* Visible keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  font-weight: 500;
  border-radius: var(--radius-md);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.skip-link:focus-visible {
  outline-color: var(--color-foreground);
}

.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: var(--spacing-container);
}
.container--narrow {
  max-width: 56rem;
}
.container--text {
  max-width: 64rem;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.icon--lg {
  width: 1.25rem;
  height: 1.25rem;
}
.icon--xl {
  width: 1.5rem;
  height: 1.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}
.button:hover {
  background: var(--color-primary-hover);
}
.button:focus-visible {
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border-soft);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.site-header__logo img {
  height: 2rem;
  width: auto;
}
@media (min-width: 768px) {
  .site-header__logo img {
    height: 2.5rem;
  }
}

.nav-desktop {
  display: none;
}
.nav-desktop ul,
.nav-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-desktop > ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  transition: color 0.3s;
}
.nav-link:hover {
  color: var(--color-foreground);
}
.nav-link[aria-current="page"] {
  color: var(--color-primary);
}

/* Profile icon links (header, phone menu, footer). The logos are the official
   brand files, used unchanged (docs/maintenance.md, "Brand icons"). Four 36px
   targets with 0.75rem gaps need 188px: they fit the narrowest footer column
   (192px at 768px wide). Logos never shrink; the row wraps instead. */
.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social-links > li {
  flex: none;
}
.social-links a {
  display: flex;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  transition: background-color 0.3s;
}
.social-links a:hover {
  background: var(--color-primary-tint);
}
.social-links img {
  height: 1.25rem;
  width: auto;
}
/* Desktop header: a decorative 1px rule between Contact and the icons. The
   2rem nav gap on its left equals 1.5rem gap + 0.5rem link padding on its right. */
.nav-desktop__social {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-desktop__social::before {
  content: "";
  width: 1px;
  height: 1.25rem;
  background: var(--color-border);
}
.nav-desktop .social-links {
  flex-wrap: nowrap;
  gap: 0.25rem;
  /* Pull the last icon's 0.5rem link padding past the content edge, so the
     visible TryHackMe icon is flush with it; all spacing stays the same. */
  margin-right: -0.5rem;
}

/* Phone menu: a native <details> disclosure, works without JavaScript. */
.nav-mobile summary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  list-style: none;
  cursor: pointer;
  color: var(--color-foreground);
  border-radius: var(--radius-md);
  transition: color 0.3s;
}
.nav-mobile summary::-webkit-details-marker {
  display: none;
}
.nav-mobile summary:hover {
  color: var(--color-primary);
}
.nav-mobile .icon-close,
.nav-mobile[open] .icon-open {
  display: none;
}
.nav-mobile[open] .icon-close {
  display: block;
}
.nav-mobile__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border-soft);
}
.nav-mobile__panel > ul {
  display: flex;
  flex-direction: column;
  padding: 0.5rem var(--spacing-container) 1rem;
}
/* The icon row sits under the text items; the negative margin lines the first
   logo up with the text despite the links' padding. */
.nav-mobile__social {
  padding-top: 0.25rem;
}
.nav-mobile__social .social-links {
  margin-left: -0.5rem;
}
.nav-mobile .nav-link {
  display: flex;
  padding: 0.75rem 0;
  font-size: 1rem;
  line-height: 1.5rem;
}
@media (min-width: 768px) {
  .nav-desktop {
    display: block;
  }
  .nav-mobile {
    display: none;
  }
}

/* ---------- Home: hero ---------- */
.hero {
  padding-top: 6rem;
  padding-bottom: var(--spacing-section);
}
.hero > .container > * + * {
  margin-top: 3rem;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.hero__photo {
  position: relative;
  max-width: 24rem;
}
.hero__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(to bottom right, rgb(249 255 191 / 0.2), rgb(154 115 62 / 0.2));
  transform: rotate(2deg);
}
.hero__photo img {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}
.hero__text > * + * {
  margin-top: 2rem;
}
.hero__intro > * + * {
  margin-top: 1.5rem;
}
.hero h1 {
  font-size: 2.25rem;
  line-height: 1.25;
  color: var(--color-foreground);
}
.hero__tagline {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--color-muted-foreground);
}
.hero__lead {
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--color-muted-foreground);
}
.roles {
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-soft);
  text-align: center;
}
.roles__label {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.roles__list {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
@media (min-width: 768px) {
  .hero {
    padding-top: 8rem;
  }
  .hero h1 {
    font-size: 3rem;
    line-height: 1;
  }
  .hero__tagline {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}
@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem;
  }
  .hero__photo-col {
    margin-top: 2rem;
  }
  .hero h1 {
    font-size: 3.75rem;
  }
}

/* ---------- About: essay ---------- */
.about-intro {
  padding-top: 6rem;
  padding-bottom: var(--spacing-section);
}
.about-intro h1 {
  margin-bottom: 2rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  color: var(--color-primary);
}
.essay {
  color: var(--color-muted-foreground);
  line-height: 1.625;
}
.essay__lead {
  font-size: 1.125rem;
  line-height: 1.625;
}
.essay__lead + .essay__parts {
  margin-top: 2rem;
}
.essay__parts {
  padding-top: 1rem;
}
.essay__parts > * + * {
  margin-top: 1.5rem;
}
.essay__part > * + * {
  margin-top: 0.75rem;
}
.essay__part--last {
  padding-top: 1rem;
}
.essay h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--color-primary);
}
.essay .note {
  font-style: italic;
}
.essay .strong {
  font-weight: 500;
}
.essay ul {
  padding-left: 1.5rem;
  list-style: disc;
}
.essay li + li {
  margin-top: 0.5rem;
}
@media (min-width: 768px) {
  .about-intro {
    padding-top: 8rem;
  }
  .about-intro h1 {
    font-size: 3rem;
    line-height: 1;
  }
  .essay h2 {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

/* ---------- 404 page and contact result pages (/message-sent/, /message-error/) ---------- */
.not-found,
.result {
  padding-top: 6rem;
  padding-bottom: var(--spacing-section);
  text-align: center;
}
.not-found h1,
.result h1 {
  font-size: 2.25rem;
  line-height: 2.5rem;
  color: var(--color-primary);
}
.not-found p,
.result p {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--color-muted-foreground);
}
.not-found .button,
.result .button {
  margin-top: 0.5rem;
}
/* Error page: one paragraph per reason code. contact.php redirects to
   /message-error/#CODE; the ids sit on empty anchors at the top of <main> (so the
   jump to the fragment keeps the heading in view), and the matching paragraph is
   shown. Without CSS every reason is visible and still reads correctly. */
.result__reason {
  display: none;
}
#cookies:target ~ .result .result__reason--cookies,
#toomany:target ~ .result .result__reason--toomany,
#invalid:target ~ .result .result__reason--invalid,
#failed:target ~ .result .result__reason--failed {
  display: block;
  color: var(--color-foreground);
}
@media (min-width: 768px) {
  .not-found,
  .result {
    padding-top: 8rem;
  }
  .not-found h1,
  .result h1 {
    font-size: 3rem;
    line-height: 1;
  }
}

/* ---------- About: certifications ---------- */
.certs {
  padding-block: var(--spacing-section);
  background: var(--color-secondary);
}
/* Two gold sections back to back (About page: certifications, then contact):
   one section space between their contents, not two, with a thin divider in
   its middle (like the rule above the hero's target roles). The contact section
   is pulled up by half a section space over the certifications' bottom padding
   (same colour); the divider then has half a section space on each side. */
.certs + .contact {
  padding-top: 0;
  margin-top: calc(var(--spacing-section) / -2);
}
.certs + .contact::before {
  content: "";
  display: block;
  width: calc(100% - 2 * var(--spacing-container));
  max-width: calc(80rem - 2 * var(--spacing-container));
  height: 1px;
  margin: 0 auto calc(var(--spacing-section) / 2 - 1px);
  background: rgb(0 0 0 / 0.2);
}
.certs__heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  margin-bottom: 2rem;
}
.certs__heading .icon {
  color: var(--color-primary);
}
.certs__heading h2 {
  font-size: 1.5rem;
  line-height: 2rem;
}
.cert-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cert-card {
  padding: 1.5rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
  transition: border-color 0.3s;
}
.cert-card:hover {
  border-color: rgb(249 255 191 / 0.5);
}
.cert-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  background: var(--color-background);
  border-radius: var(--radius-lg);
}
.cert-card__badge img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}
.cert-card h3 {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--color-primary);
}
.cert-card p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-muted-foreground);
}
@media (min-width: 640px) {
  /* Fixed-width cards (the width they had in the old 4-column track), as many
     per row as fit, centred as a group. Works for any number of cards. */
  .cert-grid {
    grid-template-columns: repeat(auto-fit, 13.875rem);
    justify-content: center;
  }
}
@media (min-width: 768px) {
  .certs__heading h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--spacing-section);
  background: var(--color-secondary);
}
/* 1.375rem / 1.875rem (from 768px) margin: the visible gap from the intro
   text to the form card is 24px / 32px with the text's ~2px descent below it. */
.contact__header {
  margin-bottom: 1.375rem;
  text-align: center;
}
.contact__header h2 {
  margin-bottom: 1rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.contact__header p {
  max-width: 32rem;
  margin-inline: auto;
  color: var(--color-primary);
}
.contact-form {
  padding: 1.5rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}
.contact-form > * + * {
  margin-top: 1.5rem;
}
.contact-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
.field label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
.field label .icon {
  color: var(--color-muted);
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-foreground);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field textarea {
  resize: vertical;
  min-height: 8.5rem;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-muted);
  opacity: 1;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgb(249 255 191 / 0.5);
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.contact-form .button {
  width: 100%;
  padding-block: 1rem;
}
/* Honeypot: off-screen for people, still present for bots that fill every field. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (min-width: 768px) {
  .contact__header {
    margin-bottom: 1.875rem;
  }
  .contact__header h2 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  .contact-form {
    padding: 2rem;
  }
  .contact-form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
}
.site-footer > .container {
  padding-block: 2.25rem 1.75rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
/* Everything in the footer is centred: each group within its column. */
.footer__col {
  text-align: center;
}
.footer__col > * + * {
  margin-top: 1rem;
}
.footer__logo {
  display: inline-block;
}
.footer__logo img {
  height: 2.5rem;
  width: auto;
}
.footer__tagline,
.footer__copy {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-muted-foreground);
}
.footer__heading {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}
/* One row like the Connect icons beside it: 36px links (0.5rem padding around a
   1.25rem line) with the same 0.75rem gaps, so both rows centre at the same y. */
.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__nav a {
  display: block;
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-muted-foreground);
  transition: color 0.3s;
}
.footer__nav a:hover {
  color: var(--color-primary);
}
.site-footer .social-links {
  justify-content: center;
}
.footer__bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
}
.footer__copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer__copy .icon {
  color: var(--color-primary);
}
@media (min-width: 768px) {
  .site-footer > .container {
    padding-top: 3rem;
  }
  /* Two bands across the three columns (subgrid): the logo on the headings'
     row, the tagline on the link and icon row, each centred in its band. */
  .footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 1rem 4rem;
  }
  .footer__col {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-items: center;
  }
  .footer__col > * + * {
    margin-top: 0;
  }
  .footer__logo {
    justify-self: center;
  }
  .footer__logo img {
    display: block;
  }
}
/* Columns side by side but narrow (192px at 768px): the three links need ~203px
   with 0.5rem side padding and would wrap below ~801px, so trim it here only. */
@media (min-width: 768px) and (max-width: 820px) {
  .footer__nav a {
    padding: 0.5rem 0.25rem;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
