/* ============================================================
   Stylas Proposal — custom styles
   Συμπληρώνει το Tailwind με typography refinements, grain,
   card hovers και CTA states.
   ============================================================ */

:root {
  --paper: #F4EFE6;
  --paper-alt: #ECE5D8;
  --ink: #1B1814;
  --ink-soft: #4A4239;
  --accent: #B5471F;
  --accent-soft: #E5D4C3;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-feature-settings: "ss01", "cv02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fraunces optical sizing για display headings */
.font-display {
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  letter-spacing: -0.015em;
}

/* ----------------------------------------------------------
   Grain overlay — δίνει paper-like υφή σε όλη τη σελίδα
   ---------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------
   Header — scroll state (managed by JS)
   ---------------------------------------------------------- */
#site-header.is-scrolled {
  background-color: rgba(244, 239, 230, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#site-header.is-scrolled #header-divider {
  background-color: rgba(27, 24, 20, 0.08);
}

.nav-link {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link:hover::after { right: 0; }

/* ----------------------------------------------------------
   CTA buttons
   ---------------------------------------------------------- */
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.cta-primary svg { transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cta-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(181, 71, 31, 0.5);
}
.cta-primary:hover svg { transform: translateX(4px); }

.cta-dark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cta-dark svg { transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cta-dark:hover {
  background: var(--accent);
  color: var(--paper);
  transform: translateY(-2px);
}
.cta-dark:hover svg { transform: translateX(5px); }

/* ----------------------------------------------------------
   Portfolio cards
   ---------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid rgba(27, 24, 20, 0.1);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid transparent;
  pointer-events: none;
  transition: border-color 0.3s ease;
  z-index: 2;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(27, 24, 20, 0.25);
  box-shadow: 0 24px 48px -20px rgba(27, 24, 20, 0.18);
}
.card:hover::before { border-top-color: var(--accent); }
.card:hover .card-arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}

/* Screenshot preview */
.card-shot {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: var(--paper-alt);
  border-bottom: 1px solid rgba(27, 24, 20, 0.08);
}
.card-shot--tall { aspect-ratio: 4 / 3; }
.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.4s ease;
  filter: saturate(0.95);
}
.card-shot::after {
  /* Very subtle warm tint για ενοποίηση με το paper palette */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(27, 24, 20, 0.08));
  pointer-events: none;
}
.card:hover .card-shot img {
  transform: scale(1.04);
  filter: saturate(1.05);
}

.card-body {
  padding: 22px 24px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* "Γιατί X" explanation per card */
.card-why {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding-top: 14px;
  border-top: 1px dashed rgba(27, 24, 20, 0.12);
}
.card-why-label {
  display: inline;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  margin-right: 4px;
}
.card-arrow {
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.card-tags {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-tags span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 10px;
  border: 1px solid rgba(27, 24, 20, 0.12);
  border-radius: 999px;
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-dot--live {
  background: #4a8c3a;
  box-shadow: 0 0 0 3px rgba(74, 140, 58, 0.18);
}
.status-dot--dev {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 71, 31, 0.18);
}

/* ----------------------------------------------------------
   Tech badges
   ---------------------------------------------------------- */
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(27, 24, 20, 0.15);
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: default;
}
.tech-badge:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.tech-badge--accent {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.tech-badge--accent:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* ----------------------------------------------------------
   Reveal-on-scroll animation (triggered by IntersectionObserver)
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------
   Mobile refinements
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  html { scroll-padding-top: 70px; }
  .cta-primary, .cta-dark { padding: 14px 22px; font-size: 13px; }
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--paper);
}
