*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f7f6f3;
  --bg-card: #ffffff;
  --bg-card-hover: #f2f1ee;
  --text: #0e0e0d;
  --text-secondary: #6b6b67;
  --text-tertiary: #9f9f9a;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.15);
  --accent-soft: rgba(14, 14, 13, 0.06);
  --nav-bg: rgba(247, 246, 243, 0.85);
  --tag-bg: #ededea;
  --tag-text: #4a4a47;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0b;
    --bg-card: #161615;
    --bg-card-hover: #1e1e1c;
    --text: #f0efe9;
    --text-secondary: #9a9a94;
    --text-tertiary: #5a5a56;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --accent-soft: rgba(240, 239, 233, 0.06);
    --nav-bg: rgba(12, 12, 11, 0.85);
    --tag-bg: #222220;
    --tag-text: #9a9a94;
  }
}

/* ─── I18N CONTENT GUARD ─── */
html.i18n-loading body {
  visibility: hidden;
}

html.i18n-loading {
  background: var(--bg);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 1160px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border: 0.5px solid var(--border);
  border-radius: 100px;
}

@media (max-width: 640px) {
  nav {
    width: calc(100% - 1rem);
  }
}

.nav-inner {
  width: 100%;
  padding: 0 1rem 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-svg {
  width: 32px;
  height: 32px;
}

.logo-name {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.lang-switch button {
  all: unset;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: color 0.2s;
}

.lang-switch button.active,
.lang-switch button:hover {
  color: var(--text);
}

.lang-divider {
  font-size: 12px;
  opacity: 0.5;
}

.nav-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--bg) !important;
  background: var(--text);
  padding: 8px 18px;
  border-radius: 100px;
  text-decoration: none;
  transition: opacity 0.2s;
  letter-spacing: -0.01em;
}

.nav-cta:hover {
  opacity: 0.8;
}

/* ─── SECTIONS ─── */
section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  scroll-margin-top: 92px;
}

/* ─── HERO ─── */
#hero {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  align-items: flex-start;
  gap: 4rem;
  padding-top: 160px;
  padding-bottom: 40px;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
  scroll-margin-top: 92px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-right {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  animation: fadeInRight 1s ease 0.3s forwards;
  margin-top: 1.25rem;
}

.hero-headline {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 820px;
  margin-bottom: 2rem;
}

.hero-headline em {
  font-style: italic;
  color: var(--text-secondary);
}

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  padding: 13px 28px;
  border-radius: 100px;
  text-decoration: none;
  transition: opacity 0.2s;
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  opacity: 0.8;
}

/* ─── SECTION HEADER ─── */
.section-header {
  padding-top: 40px;
  padding-bottom: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4rem;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-top: 6px;
  min-width: 100px;
  font-weight: 400;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 600px;
}

.section-title em {
  font-style: italic;
  color: var(--text-secondary);
}

/* ─── WORK CARDS ─── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.work-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.work-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.work-card-visual {
  width: 100%;
  height: 240px;
  position: relative;
}

.work-card-visual.foodobox {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.work-card-visual.trixie {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

@media (prefers-color-scheme: dark) {
  .work-card-visual.foodobox {
    background: linear-gradient(135deg, #0d2b10 0%, #133a16 100%);
  }

  .work-card-visual.trixie {
    background: linear-gradient(135deg, #1a1228 0%, #261540 100%);
  }
}

.work-card-visual-label {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  opacity: 0.25;
  font-family: 'DM Serif Display', serif;
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  line-height: 1;
}

.foodobox .work-card-visual-label {
  color: #1b5e20;
}

.trixie .work-card-visual-label {
  color: #4a1d96;
}

@media (prefers-color-scheme: dark) {
  .foodobox .work-card-visual-label {
    color: #a5d6a7;
  }

  .trixie .work-card-visual-label {
    color: #c4b5fd;
  }
}

.work-card-body {
  padding: 1.5rem;
}

.work-card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 400;
}

.work-card-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.work-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 1.25rem;
}

.work-card-link {
  font-size: 13px;
  color: var(--text-tertiary);
}

.work-card:hover .work-card-link {
  color: var(--text-secondary);
}

/* ─── PRINCIPLES ─── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 60px;
}

.principle-card {
  background: var(--bg-card);
  padding: 2.5rem;
  transition: background 0.2s;
}

.principle-card:hover {
  background: var(--bg-card-hover);
}

.principle-num {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.principle-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.principle-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 300;
}

/* ─── APPROACH ─── */
.approach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
  align-items: start;
}

@media (max-width: 700px) {
  .approach-grid {
    grid-template-columns: 1fr;
  }
}

.approach-text h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}

.approach-text h3 em {
  font-style: italic;
  color: var(--text-secondary);
}

.approach-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.approach-steps {
  border: 0.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.approach-step {
  padding: 1.25rem 1.5rem;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card);
}

.approach-step:last-child {
  border-bottom: none;
}

.step-num {
  font-size: 12px;
  color: var(--text-tertiary);
  min-width: 24px;
  padding-top: 2px;
}

.step-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.55;
}

/* ─── CONTACT ─── */
#contact {
  padding-bottom: 80px;
}

.contact-inner {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 24px;
  padding: 4rem;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (max-width: 700px) {
  .contact-inner {
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
  }
}

.contact-text h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
}

.contact-text h2 em {
  font-style: italic;
  color: var(--text-secondary);
}

.contact-text p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.7;
  font-weight: 300;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 320px;
  flex: 1;
  max-width: 420px;
}

@media (max-width: 700px) {
  .contact-form {
    min-width: 0;
    width: 100%;
  }
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field {
  flex: 1;
}

input:not([type="checkbox"]):not([type="hidden"]),
textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  -webkit-appearance: none;
}

input:not([type="checkbox"])::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

input:not([type="checkbox"]):not([type="hidden"]):focus,
textarea:focus {
  border-color: var(--text-secondary);
}

/* ─── INLINE FIELD VALIDATION ─── */
.is-invalid {
  border-color: rgba(200, 50, 50, 0.4) !important;
}

.field-error {
  font-size: 12px;
  color: #b33030;
  font-weight: 300;
  margin-top: 2px;
  padding-left: 4px;
}

.consent-error {
  font-size: 12px;
  color: #b33030;
  font-weight: 300;
  margin-top: 2px;
}

@media (prefers-color-scheme: dark) {
  .is-invalid {
    border-color: rgba(239, 83, 80, 0.4) !important;
  }

  .field-error,
  .consent-error {
    color: #ef9a9a;
  }
}

/* ─── CONSENT CHECKBOX ─── */
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 300;
  margin-top: 4px;
}

.form-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: var(--text);
  cursor: pointer;
}

.form-consent a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.form-consent a:hover {
  color: var(--text);
}

/* ─── TURNSTILE WIDGET ─── */
.cf-turnstile {
  margin-top: 4px;
}

/* ─── FORM SUBMIT ─── */
.form-submit {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: none;
  padding: 13px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: -0.01em;
  align-self: flex-end;
  margin-top: 16px;
}

.form-submit:hover {
  opacity: 0.75;
}

.form-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-success-msg {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 16px;
  letter-spacing: -0.01em;
}

/* ─── FORM FEEDBACK (success/server error only) ─── */
.form-feedback {
  font-size: 14px;
  font-weight: 400;
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 8px;
  display: none;
}

.form-feedback.is-visible {
  display: block;
}

.form-feedback.is-success {
  background: rgba(34, 139, 34, 0.08);
  color: #1b7a1b;
  border: 0.5px solid rgba(34, 139, 34, 0.2);
}

.form-feedback.is-error {
  background: rgba(200, 50, 50, 0.08);
  color: #b33030;
  border: 0.5px solid rgba(200, 50, 50, 0.2);
}

@media (prefers-color-scheme: dark) {
  .form-feedback.is-success {
    background: rgba(76, 175, 80, 0.1);
    color: #81c784;
    border-color: rgba(76, 175, 80, 0.2);
  }

  .form-feedback.is-error {
    background: rgba(239, 83, 80, 0.1);
    color: #ef9a9a;
    border-color: rgba(239, 83, 80, 0.2);
  }
}

/* ─── HONEYPOT (hidden from humans) ─── */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  tab-index: -1;
}

/* ─── FOOTER ─── */
footer {
  border-top: 0.5px solid var(--border);
  padding: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  #hero {
    grid-template-columns: 1fr;
  }

  .hero-right {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-headline {
    font-size: 2.6rem;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
  }

  .principles-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── TERMINAL ANIMATION (hero) ─── */
.term-wrap {
  font-family: 'DM Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  position: relative;
  height: 100%;
  mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 72%, transparent 100%);
}

.term-inner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  animation: termScroll 28s linear infinite;
}

@keyframes termScroll {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-50%);
  }
}

.term-line {
  padding: 1px 0;
  white-space: pre;
}

.term-prompt {
  color: var(--text-tertiary);
}

.term-key {
  color: var(--text);
  font-weight: 500;
}

.term-str {
  color: var(--text-secondary);
}

.term-comment {
  color: var(--text-tertiary);
  font-style: italic;
}

.term-blank {
  height: 16px;
}

/* ─── PRIVACY PAGE ─── */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 160px 2rem 80px;
}

.page-content h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--text);
}

.page-content h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.page-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 1rem;
}

.page-content a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.page-content a:hover {
  color: var(--text);
}

.page-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 0.25rem;
}