/* ============================================================
   crobase.de — Component Styles
   Depends on tokens.css being loaded first.
   ============================================================ */

/* === 1. RESET & BASE ======================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--c-paper);
}

section {
  scroll-margin-top: var(--header-h);
}

input, textarea {
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
}

textarea {
  resize: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* === 2. UTILITIES =========================================== */

.section-label {
  font-size: var(--t-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: var(--font-body);
}

.section-label--accent { color: var(--accent); }
.section-label--muted  { color: var(--c-text-muted); }

.cta-link {
  display: inline-block;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity .2s;
}

.cta-link:hover { opacity: 0.66; }

.accent-text { color: var(--accent); }

/* === 3. HEADER ============================================== */

#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--gutter);
  height: var(--header-h);
  background: rgba(239, 235, 225, 0.82);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
}

.wordmark {
  height: 17px;
  width: auto;
  display: block;
}

#site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.lang-sep {
  color: #C2BAAD;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-family: var(--font-body);
  color: #9A9087;
  transition: color .15s;
}

.lang-btn.active,
.lang-btn[aria-pressed="true"] {
  color: var(--accent);
}

#nav-contact {
  font-size: 14px;
  color: var(--c-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 26, 23, 0.28);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: opacity .2s;
}

#nav-contact:hover { opacity: 0.66; }

/* === 4. HERO ================================================ */

#hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.82fr;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h));
}

#hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 64px 80px var(--gutter);
  max-width: 760px;
}

.hero-rule {
  width: 54px;
  height: 1px;
  background: var(--accent);
  margin: 28px 0 30px;
}

#hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  color: var(--c-text);
  margin: 0;
}

#hero-headline span {
  display: block;
}

#hero-body {
  font-size: 18px;
  line-height: 1.72;
  color: var(--c-text-body);
  max-width: 500px;
  margin: 34px 0 0;
  text-wrap: pretty;
}

#hero-copy .cta-link {
  margin-top: 38px;
  align-self: flex-start;
}

#hero-portrait {
  position: relative;
  overflow: hidden;
}

#hero-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 16%;
}

.hero-portrait-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #EFEBE1 0%, rgba(239, 235, 225, 0.55) 16%, rgba(239, 235, 225, 0) 46%),
    linear-gradient(0deg,   #EFEBE1 0%, rgba(239, 235, 225, 0) 22%),
    linear-gradient(180deg, #EFEBE1 0%, rgba(239, 235, 225, 0) 16%);
}

/* === 5. POINT OF VIEW ======================================= */

#pov {
  padding: var(--section-y) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pov-rule {
  width: 40px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
  margin-bottom: 52px;
}

#pov-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-pov);
  line-height: 1.5;
  color: #2A2620;
  max-width: var(--maxw-text);
  text-align: left;
  margin: 0;
  text-wrap: pretty;
}

/* === 6. HOW I WORK ========================================== */

#work {
  padding: 40px var(--gutter) var(--section-y);
}

.work-inner {
  max-width: var(--maxw-page);
  margin: 0 auto;
}

#work-intro {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 1.18;
  color: var(--c-text);
  margin: 22px 0 0;
  max-width: 620px;
  letter-spacing: -0.01em;
}

#work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  margin-top: 76px;
}

.work-item-rule {
  width: 28px;
  height: 1px;
  background: rgba(28, 26, 23, 0.25);
  margin-bottom: 26px;
}

.work-item h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
  font-family: var(--font-body);
}

.work-item p {
  font-size: var(--t-body-sm);
  line-height: var(--lh-body);
  color: var(--c-text-soft);
  margin: 0;
  text-wrap: pretty;
}

.work-closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin-top: 96px;
  text-align: center;
}

.work-closing-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.45;
  color: #2A2620;
  max-width: 560px;
  margin: 0;
}

/* === 7. PROOF =============================================== */

#proof {
  background: var(--c-surface);
  padding: 120px var(--gutter);
}

.proof-inner {
  max-width: 720px;
  margin: 0 auto;
}

#proof-p1 {
  font-size: 19px;
  line-height: 1.76;
  color: #2E2A24;
  margin: 36px 0 0;
  text-wrap: pretty;
}

#proof-p2 {
  font-size: 19px;
  line-height: 1.76;
  color: #2E2A24;
  margin: 30px 0 0;
  text-wrap: pretty;
}

/* === 8. ABOUT =============================================== */

#about {
  padding: 124px var(--gutter);
}

#about-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 72px;
  align-items: start;
}

#about-p1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 26px);
  line-height: 1.45;
  color: var(--c-text);
  margin: 28px 0 0;
  text-wrap: pretty;
}

#about-p2 {
  font-size: 17.5px;
  line-height: 1.74;
  color: var(--c-text-soft);
  margin: 30px 0 0;
  text-wrap: pretty;
}

#about-p3 {
  font-size: 17.5px;
  line-height: 1.74;
  color: var(--c-text-soft);
  margin: 24px 0 0;
  text-wrap: pretty;
}

#about-portrait {
  position: relative;
  height: 560px;
  overflow: hidden;
}

#about-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  filter: brightness(1.03);
}

.about-portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(239, 235, 225, 0) 72%, #EFEBE1 100%);
}

/* === 9. CONTACT ============================================= */

#contact {
  padding: 40px var(--gutter) var(--section-y);
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
}

.contact-opening {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-lead);
  line-height: var(--lh-snug);
  color: var(--c-text);
  text-align: center;
  margin: 0 0 56px;
  text-wrap: pretty;
}

/* Form */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-field label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  border: none;
  border-bottom: 1px solid var(--c-line-strong);
  background: transparent;
  padding: 8px 0;
  font-size: var(--t-body-sm);
  color: var(--c-text);
  transition: border-color .2s;
}

.form-field input.error,
.form-field textarea.error {
  border-bottom-color: var(--accent);
}

#btn-submit {
  margin-top: 8px;
  align-self: flex-start;
  background: var(--accent);
  color: #F3EFE7;
  border: none;
  border-radius: var(--radius);
  padding: 15px 30px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s;
}

#btn-submit:hover { background: var(--accent-hover); }

.contact-email-row {
  text-align: center;
  margin-top: 52px;
}

.contact-email-row a {
  font-size: 15px;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: opacity .2s;
}

.contact-email-row a:hover { opacity: 0.66; }

/* === 10. FOOTER ============================================= */

#site-footer {
  padding: 30px var(--gutter);
  border-top: 1px solid rgba(28, 26, 23, 0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
}

.footer-links a {
  color: var(--c-text-faint);
  text-decoration: none;
  transition: opacity .2s;
}

.footer-links a:hover { opacity: 0.66; }

/* === 11. COOKIE NOTICE ====================================== */

#cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(28, 26, 23, 0.96);
  color: #DED7CC;
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

#cookie-notice[hidden] { display: none; }

#cookie-text {
  font-size: 13.5px;
  line-height: 1.5;
}

#cookie-accept {
  background: none;
  border: 1px solid rgba(222, 215, 204, 0.4);
  color: #DED7CC;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s;
}

#cookie-accept:hover { border-color: rgba(222, 215, 204, 0.7); }

/* === 12. REVEAL ANIMATION =================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === 13. RESPONSIVE (980px) ================================= */

@media (max-width: 980px) {
  #site-header {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  /* Hero: single column, portrait band above */
  #hero-grid {
    grid-template-columns: 1fr;
  }

  #hero-portrait {
    position: relative;
    width: calc(100% + 56px);
    margin-left: -28px;
    height: 56vh;
    min-height: 470px;
    order: -1;
  }

  #hero-portrait img {
    object-position: 60% 14%;
  }

  #hero-copy {
    padding: 40px var(--gutter-mobile) 64px;
    max-width: none;
  }

  /* Sections: mobile gutter */
  #pov,
  #work,
  #proof,
  #about,
  #contact,
  #site-footer {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  /* How I Work: single column */
  #work-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  /* About: single column, portrait below */
  #about-grid {
    grid-template-columns: 1fr;
  }

  #about-portrait {
    height: 60vh;
    max-width: 460px;
  }
}
