/* =========================================================
   oriven.org — Tomas Novak
   Minimal dark theme, personal-professional, calm.
   Palette:
     --ink-0 #051F20  (darkest — page background)
     --ink-1 #0B2B26  (alt sections, cards)
     --ink-2 #163832  (elevated surfaces, borders)
     --ink-3 #235347  (borders, quiet accents)
     --accent #8EB69B (primary accent)
     --fg    #E6EDE8  (primary text)
     --mute  #A8B8B0  (secondary text)
   ========================================================= */

:root {
  --ink-0: #051F20;
  --ink-1: #0B2B26;
  --ink-2: #163832;
  --ink-3: #235347;
  --accent: #8EB69B;
  --accent-strong: #A5C7B1;
  --fg: #E6EDE8;
  --mute: #A8B8B0;
  --soft: rgba(142, 182, 155, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 1120px;
  --ease: cubic-bezier(.2,.7,.2,1);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

::selection { background: var(--accent); color: var(--ink-0); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: var(--accent); color: var(--ink-0);
  padding: .6rem 1rem; border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; z-index: 1000; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 31, 32, 0.75);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid rgba(35, 83, 71, 0.5);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--fg);
  letter-spacing: .02em;
  line-height: 1;
}
.brand:hover { color: var(--fg); }
.brand-mark { color: var(--accent); font-size: .9em; }
.brand-dot { color: var(--accent); }

/* Logo image in header. Expects a transparent-background PNG/SVG.
   If the file is missing, the text fallback appears instead. */
/* Brand logo — transparent PNG wordmark in white.
   The exported PNG has generous whitespace around the letters, so we lean on
   a larger display height to compensate. It sits directly on the header with
   no badge/background. */
.brand-logo {
  height: 56px; width: auto; display: block;
  /* Slightly lift the contrast against the dark-green header */
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.3));
  /* Compensate for the baked-in whitespace by nudging vertically */
  margin: -4px 0;
}
@media (max-width: 720px) {
  .brand-logo { height: 44px; margin: -2px 0; }
}
.brand-text-fallback {
  display: none; align-items: baseline; gap: 8px;
}

.site-nav { display: flex; align-items: center; }
.nav-list {
  display: flex; gap: 22px;
  list-style: none; padding: 0; margin: 0;
}
.nav-list a {
  color: var(--mute);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color .2s var(--ease);
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-list a:hover { color: var(--fg); }
.nav-list a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 18px; height: 1.5px; background: var(--fg); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}

.lang-switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--mute);
}
.lang-btn {
  background: transparent; border: 0; padding: 4px 6px;
  color: var(--mute); cursor: pointer;
  font: inherit; letter-spacing: .05em;
  border-radius: 4px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.lang-btn[aria-pressed="true"] { color: var(--accent); }
.lang-btn:hover { color: var(--fg); }
.lang-sep { opacity: .5; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 8vw, 96px);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(142,182,155,.08), transparent 60%),
    radial-gradient(800px 400px at -10% 10%, rgba(35,83,71,.25), transparent 60%),
    var(--ink-0);
  border-bottom: 1px solid rgba(35,83,71,.35);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 600;
}
.lede {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--mute);
  margin: 0 0 32px;
  max-width: 56ch;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* Portrait */
.hero-portrait { display: flex; justify-content: center; }
.portrait-frame {
  position: relative;
  width: min(320px, 80%);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--ink-3);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.8);
}
.portrait-frame img {
  width: 100%; height: 100%; object-fit: cover;
  /* Crisp edges for the pixel-art portrait */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.portrait-placeholder {
  font-family: var(--font-mono);
  font-size: 64px; color: var(--accent);
  letter-spacing: .08em;
  opacity: .8;
}
.portrait-frame:not(.no-photo) .portrait-placeholder { display: none; }
.portrait-frame.no-photo .portrait-placeholder { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 500; font-size: 15px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn-primary {
  background: var(--accent); color: var(--ink-0);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--ink-0); }
.btn-ghost {
  background: transparent; color: var(--fg);
  border-color: var(--ink-3);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

/* ---------- Section base ---------- */
.section {
  padding: clamp(64px, 9vw, 120px) 0;
  border-bottom: 1px solid rgba(35,83,71,.25);
}
.section-alt { background: var(--ink-1); }
.section-label {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-title {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 36px;
  font-weight: 600;
  max-width: 28ch;
}
.prose p { margin: 0 0 1em; max-width: 68ch; color: var(--fg); }
.prose .muted, .muted { color: var(--mute); }
.muted-note { color: var(--mute); font-size: 14px; margin-top: 28px; }

/* ---------- Cards (What I do) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--ink-1);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.section-alt .card { background: var(--ink-0); }
.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card p {
  margin: 0; color: var(--mute); font-size: 15px; line-height: 1.6;
}
.card:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  gap: 12px;
}
.project {
  background: var(--ink-0);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  transition: border-color .25s var(--ease);
}
.project:hover { border-color: var(--ink-3); }
.project-meta .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .05em;
  color: var(--accent);
  background: var(--soft);
  border: 1px solid rgba(142,182,155,.25);
  padding: 6px 10px; border-radius: 999px;
}
.project h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}
.project p { margin: 0; color: var(--mute); }

/* ---------- Principles (How I work) ---------- */
.principles {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.principles li {
  display: flex; gap: 16px;
  padding: 22px;
  background: var(--ink-1);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
}
.principle-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  padding-top: 3px;
}
.principles h3 {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 600;
}
.principles p { margin: 0; color: var(--mute); font-size: 15px; }

/* ---------- Interests ---------- */
.interests {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.interest {
  padding: 24px;
  background: var(--ink-0);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
}
.interest h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.interest p { margin: 0; color: var(--mute); font-size: 15px; }

/* ---------- Contact ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-copy .section-title { margin-bottom: 20px; }
.contact-form {
  display: grid; gap: 14px;
  background: var(--ink-1);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.field { display: grid; gap: 6px; }
.field label {
  font-size: 13px;
  color: var(--mute);
  font-family: var(--font-mono);
  letter-spacing: .05em;
}
.field input, .field textarea {
  width: 100%;
  background: var(--ink-0);
  color: var(--fg);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit; font-size: 15px;
  resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142,182,155,.15);
}
.hp {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.form-status {
  min-height: 1.2em; margin: 4px 0 0; font-size: 14px;
}
.form-status.ok { color: var(--accent-strong); }
.form-status.err { color: #E08F8F; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 0 40px;
  background: var(--ink-0);
  color: var(--mute);
  font-size: 14px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
}
.footer-brand { margin: 0; font-family: var(--font-mono); color: var(--fg); line-height: 1; }
.footer-logo { height: 40px; width: auto; display: inline-block; vertical-align: middle; margin: -4px 0; }
.footer-brand-fallback { display: none; }
.footer-line { margin: 0; }
.footer-year { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-portrait { order: -1; }
  .portrait-frame { width: 180px; }
  .project { grid-template-columns: 1fr; gap: 12px; }
  .contact-wrap { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .lang-switch { order: 2; margin-left: auto; }
  .site-nav { position: static; }
  .nav-list {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--ink-0);
    border-bottom: 1px solid var(--ink-2);
    padding: 8px 24px 20px;
    display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list li { border-top: 1px solid var(--ink-2); }
  .nav-list li:first-child { border-top: 0; }
  .nav-list a { display: block; padding: 14px 0; font-size: 15px; }
  .nav-list a::after { display: none; }
}

@media (max-width: 480px) {
  .section { padding: 56px 0; }
  .hero { padding-top: 48px; }
}
