/* ============================================================
   Pere Palou — Software & IT Consulting
   "Warm editorial" system — paper, ink, restrained terracotta
   ============================================================ */

:root {
  --paper:   #f5f2ea;
  --paper-2: #efeadf;
  --paper-3: #e8e2d4;
  --ink:     #1d1b16;
  --ink-2:   #34302a;
  --ink-dim: #6b665b;
  --ink-faint: #9a9382;
  --line:    rgba(29, 27, 22, 0.14);
  --line-2:  rgba(29, 27, 22, 0.26);
  --accent:  #b0492a;   /* terracotta — used sparingly */
  --accent-soft: rgba(176, 73, 42, 0.10);
  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 76px);
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "Hanken Grotesk", system-ui, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------- shared layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 500;
}

.section { padding-block: clamp(72px, 10vw, 152px); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-bottom: clamp(40px, 5vw, 66px);
}
.section-head .idx {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 6px;
  flex: none;
}
.section-head .title { flex: 1; }
.section-head h2 {
  margin: 10px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -0.012em;
}
.section-head h2 em { font-style: italic; color: var(--accent); }
.section-head p {
  margin: 16px 0 0;
  max-width: 48ch;
  color: var(--ink-dim);
  font-size: 1.04rem;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(245, 242, 234, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .brand-name { font-family: var(--font-serif); font-weight: 500; font-size: 1.35rem; letter-spacing: -0.01em; white-space: nowrap; transition: opacity .2s; }
.brand .brand-name .bd { color: var(--accent); }
.brand .brand-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; padding-left: 12px; border-left: 1px solid var(--line-2); }
.brand:hover .brand-name { opacity: 0.7; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  text-transform: uppercase;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::before { content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 5px; background: var(--accent); transform: translateY(-50%); }
.nav-cta {
  border: 1px solid var(--line-2);
  padding: 11px 19px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.nav-cta:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; align-items: center; }
.lang-switch a {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 4px 7px; line-height: 1;
  transition: color .2s;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active { color: var(--accent); }
.lang-switch a + a { border-left: 1px solid var(--line-2); }
@media (max-width: 860px) { .nav-links { display: none; } }
@media (max-width: 420px) { .nav-cta { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(144px, 18vh, 224px); padding-bottom: clamp(60px, 8vw, 110px); position: relative; }
.hero .eyebrow { display: flex; align-items: center; gap: 13px; margin-bottom: 32px; }
.hero .eyebrow .bar { height: 1px; width: 46px; background: var(--accent); }
.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6.6vw, 5.1rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-weight: 500;
  max-width: 17ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede {
  margin: clamp(40px, 5vw, 56px) 0 0;
  max-width: 54ch;
  font-size: clamp(1.08rem, 1.55vw, 1.3rem);
  color: var(--ink-2);
  line-height: 1.6;
}
.hero .lede b { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 42px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  padding: 15px 25px;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 500; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { border-color: var(--ink); }

/* hero meta strip */
.hero-meta {
  margin-top: clamp(56px, 8vw, 98px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 30px) clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
  padding-top: clamp(26px, 3vw, 34px);
}
.hero-meta div { padding: 0; }
.hero-meta .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.hero-meta .v { font-family: var(--font-serif); font-size: 1.55rem; font-weight: 500; letter-spacing: -0.01em; margin-top: 10px; }
.hero-meta .v small { font-size: .82rem; color: var(--ink-dim); font-weight: 400; font-family: var(--font-sans); }
@media (max-width: 720px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
}

/* availability dot (static, calm) */
.dot-avail { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 34px 42px;
  position: relative;
  transition: background .25s ease;
  overflow: hidden;
}
.service::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--accent); transition: width .4s cubic-bezier(.2,.7,.2,1);
}
.service:hover { background: var(--paper-2); }
.service:hover::after { width: 100%; }
.service .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.service h3 { font-family: var(--font-serif); margin: 18px 0 12px; font-size: 1.45rem; font-weight: 500; letter-spacing: -0.01em; }
.service p { margin: 0; color: var(--ink-dim); font-size: .98rem; line-height: 1.55; }
.service .stack { margin-top: 20px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; }
.service .stack a { color: var(--accent); }
@media (max-width: 720px) { .services { grid-template-columns: 1fr; } }

/* ---------- tech spec sheet ---------- */
.spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.spec-col { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 30px 28px 34px; }
.spec-col:nth-child(3n) { border-right: none; }
.spec-col h4 {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px; font-weight: 500;
  display: flex; justify-content: space-between;
}
.spec-col h4 span:last-child { color: var(--ink-faint); }
.spec-col ul { list-style: none; margin: 0; padding: 0; }
.spec-col li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 1rem; color: var(--ink);
}
.spec-col li:last-child { border-bottom: none; }
.spec-col li span { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); letter-spacing: .08em; }
@media (max-width: 820px) { .spec { grid-template-columns: repeat(2, 1fr); } .spec-col:nth-child(3n) { border-right: 1px solid var(--line); } .spec-col:nth-child(2n) { border-right: none; } }
@media (max-width: 540px) { .spec { grid-template-columns: 1fr; } .spec-col { border-right: none !important; } }

/* ---------- work / project index ---------- */
.work-list { border-top: 1px solid var(--line); }
.work-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 30px; align-items: start;
  padding: 38px 0; border-bottom: 1px solid var(--line);
  transition: background .25s ease;
}
.work-item:hover { background: var(--paper-2); }
.work-item .wnum { font-family: var(--font-mono); font-size: 13px; color: var(--accent); padding-top: 12px; letter-spacing: .06em; }
.work-item .wmain { max-width: 60ch; }
.work-item .wtag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.work-item h3 { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin: 10px 0 0; letter-spacing: -0.02em; font-weight: 500; }
.work-item .wdesc { color: var(--ink-dim); margin: 14px 0 0; }
.work-item .wstack { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; margin-top: 16px; }
.work-item .wlink {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; padding-top: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.work-item .wlink .arr { transition: transform .2s; color: var(--accent); }
.work-item:hover .wlink .arr { transform: translate(3px, -3px); }
@media (max-width: 640px) {
  .work-item { grid-template-columns: 1fr; gap: 14px; }
  .work-item .wnum { padding-top: 0; }
  .work-item .wlink { padding-top: 0; }
}

/* ---------- experience timeline ---------- */
.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 200px 1fr; gap: 36px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: background .25s ease;
}
.job:hover { background: var(--paper-2); }
.job .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); letter-spacing: .03em; padding-top: 6px; }
.job .when .now { color: var(--accent); }
.job .role .co { display: flex; align-items: baseline; gap: 13px; flex-wrap: wrap; }
.job .role h3 { font-family: var(--font-serif); font-size: 1.4rem; margin: 0; font-weight: 500; letter-spacing: -0.01em; }
.job .role .org { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.job .role p { margin: 13px 0 0; color: var(--ink-dim); font-size: .98rem; max-width: 64ch; }
@media (max-width: 640px) { .job { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-bottom: none; }
.step { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 28px 42px; position: relative; }
.step:last-child { border-right: none; }
.step .n { font-family: var(--font-serif); font-size: 2.8rem; font-weight: 400; color: var(--accent); letter-spacing: -0.02em; line-height: 1; }
.step h3 { font-family: var(--font-serif); font-size: 1.2rem; margin: 22px 0 10px; font-weight: 500; }
.step p { margin: 0; color: var(--ink-dim); font-size: .94rem; line-height: 1.5; }
@media (max-width: 820px) { .process { grid-template-columns: repeat(2, 1fr); } .step:nth-child(2n) { border-right: none; } }
@media (max-width: 460px) { .process { grid-template-columns: 1fr; } .step { border-right: none; } }

/* ---------- about ---------- */
.about-grid { display: grid; gap: clamp(28px, 4vw, 48px); align-items: start; }
.about-main .lead { font-family: var(--font-serif); font-size: clamp(1.5rem, 2.7vw, 2.1rem); line-height: 1.34; letter-spacing: -0.01em; font-weight: 400; margin: 0 0 30px; }
.about-main .lead b { color: var(--accent); font-weight: 500; font-style: italic; }
.about-main .body { color: var(--ink-dim); font-size: 1.02rem; }
.about-main .body p { margin: 0 0 18px; }
.portrait { margin: 0; max-width: 260px; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  object-position: 50% 22%;
  border: 1px solid var(--line-2);
  filter: saturate(0.96);
}
.portrait figcaption { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 0; }
.portrait figcaption .name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; }
.facts { border-top: 1px solid var(--line); margin-top: 0; max-width: 560px; }
.facts .row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.facts .row .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); flex: none; }
.facts .row .v { text-align: right; }
@media (max-width: 760px) { .portrait { max-width: 220px; } }

/* ---------- contact ---------- */
.contact h2 { font-family: var(--font-serif); font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -0.018em; font-weight: 500; margin: 0; max-width: 18ch; }
.contact h2 em { font-style: italic; color: var(--accent); }
.contact .sub { color: var(--ink-dim); margin: 26px 0 46px; max-width: 50ch; font-size: 1.12rem; }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.channel { padding: 30px 28px 36px; border-right: 1px solid var(--line); transition: background .25s; display: block; }
.channel:last-child { border-right: none; }
.channel:hover { background: var(--paper-2); }
.channel .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.channel .v { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; margin-top: 16px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; word-break: break-word; }
.channel:hover .v { color: var(--accent); }
.channel .arr { transition: transform .2s; }
.channel:hover .arr { transform: translate(3px, -3px); }
@media (max-width: 720px) { .channels { grid-template-columns: 1fr; } .channel { border-right: none; border-bottom: 1px solid var(--line); } .channel:last-child { border-bottom: none; } }

/* ---------- contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1.5fr 0.85fr; gap: clamp(36px, 5vw, 72px); align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-2);
  padding: 13px 15px;
  width: 100%;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none; appearance: none; border-radius: 0;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b665b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 38px; cursor: pointer;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: var(--paper-2); }
.field.invalid input, .field.invalid textarea { border-color: var(--accent); }
.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.contact-form .btn { background: var(--ink); border-color: var(--ink); color: var(--paper); cursor: pointer; }
.contact-form .btn:hover { background: var(--accent); border-color: var(--accent); }
.form-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; color: var(--ink-faint); }
.form-note.ok { color: #2f6b46; }
.form-note.err { color: var(--accent); }

.contact-side { display: flex; flex-direction: column; }
.side-status { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-2); padding-bottom: 20px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.side-channel { padding: 18px 0; border-bottom: 1px solid var(--line); transition: padding-left .2s; }
.side-channel:hover { padding-left: 8px; }
.side-channel .k { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.side-channel .v { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; margin-top: 8px; letter-spacing: -0.01em; }
.side-channel:hover .v { color: var(--accent); }
.side-channel .arr { transition: transform .2s; }
.side-channel:hover .arr { transform: translate(3px, -3px); }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 460px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 42px; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.foot .mono { color: var(--ink-faint); }
.foot .clock { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); letter-spacing: .05em; }
.foot .clock b { color: var(--accent); font-weight: 500; }

/* ---------- reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .07s; }
[data-reveal][data-delay="2"] { transition-delay: .14s; }
[data-reveal][data-delay="3"] { transition-delay: .21s; }
[data-reveal][data-delay="4"] { transition-delay: .28s; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }
