@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --color-background: #F5F4F0;
  --color-background-2: #FFFFFF;
  --color-background-error: #FBE6E2;
  --color-background-success: #E6EFE7;
  --color-main-1: #1F2328;
  --color-main-2: #D9402A;
  --color-on-accent: #FFFFFF;
  --color-text: #1F2328;
  --color-muted: #5E636B;
  --color-line: #DEDBD3;
  --color-link: #1F2328;
  --color-label: #5E636B;
  --color-error: #B3261E;
  --color-success: #2E6B3A;
  --color-inv-background: #1F2328;
  --color-inv-text: #F5F4F0;
  --color-inv-muted: #A3A7AD;
  --color-inv-line: #353A40;
  --font-main: 'Manrope', system-ui, sans-serif;
  --font-title: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}

/* Dark theme: set on <html data-theme="dark"> by the inline script in <head>
   (system preference on first visit, then the visitor's choice from the toggle). */
html[data-theme="dark"] {
  --color-background: #131518;
  --color-background-2: #1A1D21;
  --color-background-error: #3A1D1A;
  --color-background-success: #1A2E1F;
  --color-main-1: #EDEBE6;
  --color-main-2: #F0614A;
  --color-on-accent: #131518;
  --color-text: #EDEBE6;
  --color-muted: #9A9EA5;
  --color-line: #2A2E33;
  --color-link: #EDEBE6;
  --color-label: #9A9EA5;
  --color-error: #F2A097;
  --color-success: #8FCB9B;
  --color-inv-background: #EDEBE6;
  --color-inv-text: #131518;
  --color-inv-muted: #55595F;
  --color-inv-line: #CFCCC5;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  font-style: normal;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration-color: var(--color-main-2);
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-main-2);
}

:focus-visible {
  outline: 2px solid var(--color-main-2);
  outline-offset: 3px;
}

::selection {
  background: var(--color-main-2);
  color: var(--color-on-accent);
}

ul, ol {
  padding-left: 30px;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-size: 90px;
  @media (max-width: 1024px) {
    font-size: 60px;
  }
}

h2 {
  font-size: 54px;
  @media (max-width: 1024px) {
    font-size: 42px;
  }
  @media (max-width: 767px) {
    font-size: 36px;
  }
}

h3 {
  font-size: 48px;
  @media (max-width: 1024px) {
    font-size: 36px;
  }
}

h4 {
  font-size: 36px;
  @media (max-width: 1024px) {
    font-size: 24px;
  }
}

h5 {
  font-size: 24px;
  @media (max-width: 1024px) {
    font-size: 18px;
  }
}

h6 {
  font-size: 18px;
  @media (max-width: 1024px) {
    font-size: 16px;
  }
}

p, span, li {
  font-size: 16px;
  font-weight: 400;
  line-height: 150%;
  color: var(--color-text);
}

p {
  text-wrap: pretty;
}

/* The p/span/li rule above would shrink any <span> nested in a heading,
   link or button to 16px; those spans follow their parent instead. */
h1 span, h2 span, h3 span, h4 span, h5 span, h6 span,
a span, button span, strong span, dd span, dt span, p span {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
}

/* Accent full stop at the end of display headings: <h1>Name<em>.</em></h1> */
h1 em, h2 em, h3 em {
  font-family: var(--font-title);
  font-style: normal;
  color: var(--color-main-2);
}

/* Small mono label: eyebrows, tags, dates, section numbers */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.eyebrow-caps {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Square accent dot used in front of availability / kicker labels */
.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--color-main-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 12px;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  color: inherit;
}

.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

/* ==========================================================================
   SPACING SYSTEM
   Unified top/bottom rhythm for sections and blocks. Main sections should
   share the same vertical padding (e.g. 120px) unless the design calls for
   something different. Use these utilities instead of one-off px values.
   ========================================================================== */

.mt-120 {
  margin-top: 120px;
  @media (max-width: 1360px) {
    margin-top: 60px;
  }
}

.mt-60 {
  margin-top: 60px;
  @media (max-width: 1360px) {
    margin-top: 30px;
  }
}

.mb-120 {
  margin-bottom: 120px;
  @media (max-width: 1360px) {
    margin-bottom: 60px;
  }
}

.mb-60 {
  margin-bottom: 60px;
  @media (max-width: 1360px) {
    margin-bottom: 30px;
  }
}

/* Standard gap between a section's title block (heading ± intro paragraph)
   and whatever content follows it (button, form, cards, etc.) */
.mb-36 {
  margin-bottom: 36px;
  @media (max-width: 1360px) {
    margin-bottom: 18px;
  }
}

.pt-120 {
  padding-top: 120px;
  @media (max-width: 1360px) {
    padding-top: 60px;
  }
}

.pt-60 {
  padding-top: 60px;
  @media (max-width: 1360px) {
    padding-top: 30px;
  }
}

.pb-120 {
  padding-bottom: 120px;
  @media (max-width: 1360px) {
    padding-bottom: 60px;
  }
}

.pb-60 {
  padding-bottom: 60px;
  @media (max-width: 1360px) {
    padding-bottom: 30px;
  }
}

/* ==========================================================================
   BUTTON
   Square-cornered, flat. Hover swaps the fill (accent <-> ink) rather than
   lifting or glowing.
   ========================================================================== */

.button {
  width: fit-content;
  height: 54px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.button span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.button i,
.button .button-meta {
  transition: transform 0.25s ease;
}

.button:hover i {
  transform: translateX(3px);
}

.button-meta {
  font-family: var(--font-mono);
  font-size: 12px !important;
  font-weight: 400 !important;
  opacity: 0.7;
}

.button.btn-primary {
  background: var(--color-main-2);
  border-color: var(--color-main-2);
  color: var(--color-on-accent);
}

.button.btn-primary:hover {
  background: var(--color-main-1);
  border-color: var(--color-main-1);
  color: var(--color-background);
}

.button.btn-dark {
  background: var(--color-main-1);
  border-color: var(--color-main-1);
  color: var(--color-background);
}

.button.btn-dark:hover {
  background: var(--color-main-2);
  border-color: var(--color-main-2);
  color: var(--color-on-accent);
}

/* Transparent + outlined in the ink color. */
.button.btn-ghost {
  background: transparent;
  border-color: var(--color-main-1);
  color: var(--color-main-1);
}

.button.btn-ghost:hover {
  background: var(--color-main-1);
  border-color: var(--color-main-1);
  color: var(--color-background);
}

.button-small {
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
}

/* ==========================================================================
   NAV TOGGLE
   Hamburger button for collapsed nav (hidden on desktop — the breakpoint
   that shows it is defined per-project in style.css, next to that nav's own
   markup). main.js swaps the icon between ri-menu-line / ri-close-line and
   toggles .is-open on the nav it controls.
   ========================================================================== */

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: 3px;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
}

/* ==========================================================================
   SCROLL TO TOP
   Hidden until the page is scrolled past a threshold, then faded in.
   Toggled via .is-visible by main.js.
   ========================================================================== */

.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-main-1);
  color: var(--color-background);
  border: none;
  border-radius: 3px;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 98;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--color-main-2);
  color: var(--color-on-accent);
}

/* ==========================================================================
   LINK ARROW
   A text link with a trailing accent arrow that nudges on hover. Markup:
   <a class="link-arrow"><span>Label</span><i class="ri-arrow-right-up-line"></i></a>
   ========================================================================== */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-arrow span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.link-arrow i {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: var(--color-main-2);
  transition: transform 0.25s ease;
}

.link-arrow:hover i {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   GRID (row / col)
   Minimal flex-based grid for laying out form fields side by side.
   ========================================================================== */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.row .col {
  flex: 1 1 240px;
}

.row .col-12 {
  flex: 1 1 100%;
}

/* ==========================================================================
   FORMS
   Markup pattern (see forms/contact.php + forms/validate.js, which drives the
   submit/validation behavior behind these classes):

   <form class="contact-form-box php-email-form" data-action="forms/contact.php" novalidate>
     <div class="row">
       <div class="col col-12 form-fields">
         <label class="form-clt">
           <span class="form-label">Name</span>
           <input class="access-input" name="name" ...>
           <span class="field-error" id="err-name">...</span>
         </label>
       </div>
       <div class="col col-12">
         <div class="form-loading loading">...</div>
         <div class="form-error-msg error-message"><span></span></div>
         <div class="form-sent sent-message">...</div>
       </div>
       <div class="col col-12 form-fields">
         <div class="contact-button">
           <button type="submit" class="button btn-primary">Send</button>
         </div>
       </div>
     </div>
   </form>

   This project's form sits on a dark (inverted) panel: underline inputs that
   take their colors from the --color-inv-* tokens.
   ========================================================================== */

/* Bootstrap-style visibility hook: forms/validate.js toggles this class to
   reveal the loading/error/success states below. */
.d-block {
  display: block !important;
}

.contact-form-box {
  width: 100%;
}

.contact-form-box .row {
  gap: 18px;
}

/* After a successful send, only the success block stays visible */
.contact-form-box:has(.sent-message.d-block) .form-fields {
  display: none;
}

.form-clt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-inv-muted);
}

.access-input {
  width: 100%;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-inv-line);
  border-radius: 0;
  color: var(--color-inv-text);
  font-size: 18px;
  transition: border-color 0.2s ease;
}

.access-input::placeholder {
  color: var(--color-inv-muted);
}

.access-input:focus-visible {
  outline: none;
  border-bottom-color: var(--color-main-2);
}

textarea.access-input {
  height: auto;
  min-height: 120px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
  line-height: 1.5;
}

.access-input.input-error {
  border-bottom-color: var(--color-main-2);
}

.field-error {
  display: none;
  font-size: 13px !important;
  color: var(--color-main-2) !important;
}

.field-error.visible {
  display: block;
}

/* Honeypot: off-screen, not an .access-input, so validation ignores it */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Loading / error / success states start hidden; forms/validate.js shows
   the relevant one via .d-block. */
.loading,
.error-message,
.sent-message {
  display: none;
}

.form-loading {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-inv-muted);
}

.form-loading-spinner {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  margin-right: 12px;
  border: 2px solid var(--color-inv-line);
  border-top-color: var(--color-main-2);
  border-radius: 50%;
  animation: form-spin 0.6s linear infinite;
}

@keyframes form-spin {
  to {
    transform: rotate(360deg);
  }
}

.form-error-msg {
  padding: 12px 18px;
  border: 1px solid var(--color-main-2);
  border-radius: 2px;
}

.form-error-msg i,
.form-error-msg span {
  color: var(--color-inv-text);
  font-size: 15px;
}

.form-error-msg i {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  color: var(--color-main-2);
}

.form-sent {
  padding: 30px 0;
  border-top: 1px solid var(--color-inv-line);
  border-bottom: 1px solid var(--color-inv-line);
}

.form-sent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  background: var(--color-main-2);
  color: var(--color-on-accent);
  font-size: 20px;
  border-radius: 2px;
}

.form-sent-title {
  margin-bottom: 6px;
  color: var(--color-inv-text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.form-sent-sub {
  color: var(--color-inv-muted);
}
