/* ==========================================================================
   Serkan Algur — portfolio
   Static CSS only. No build step. No JavaScript.

   Accent note: #B5651D measures 4.15:1 on #FAFAF8 — under the 4.5:1 body-text
   requirement — so the design direction's fallback #A85A17 (4.85:1) is used as
   the accent token. On elevated surfaces (#F0EDE8) even #A85A17 drops to
   4.35:1, so text on elevated surfaces uses accent-dark #8B4513 (6.08:1).
   ========================================================================== */

:root {
  --surface: #FAFAF8;
  --surface-elevated: #F0EDE8;
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --accent: #A85A17;
  --accent-dark: #8B4513;
  --border: #D4D0C8;

  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* spacing scale: 4 / 8 / 16 / 24 / 32 / 48 / 64 / 96 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  --radius-interactive: 4px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.125rem; /* 18px */
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-4);
  overflow-wrap: break-word;
}

h1 {
  font-size: 3rem; /* 48px */
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: 1.75rem; /* 28px */
  font-weight: 600;
  line-height: 1.25;
}

h3 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--space-4);
}

ul {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Links — underline is the non-colour signal; never remove the outline
   -------------------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  border-radius: var(--radius-interactive);
  transition: color 120ms ease, text-decoration-thickness 120ms ease;
}

a:hover {
  color: var(--accent-dark);
  text-decoration-thickness: 2px;
}

a:visited {
  color: var(--accent-dark);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.section {
  padding: var(--space-8) var(--space-5);
}

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

.section__inner--wide {
  max-width: 960px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: var(--space-8) var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border);
}

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

.hero__avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: var(--space-4);
}

.hero__name {
  margin-bottom: var(--space-2);
}

.hero__subline {
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.project {
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  padding: var(--space-3);
  min-height: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.project:hover,
.project:focus-within {
  background: var(--surface-elevated);
  border-color: var(--accent);
}

/* Text on elevated surfaces uses the darker accent to hold 4.5:1 */
.project--flagship,
.project:hover,
.project:focus-within {
  color: var(--text-primary);
}

.project--flagship a,
.project:hover a,
.project:focus-within a {
  color: var(--accent-dark);
}

.project--flagship a:visited,
.project:hover a:visited,
.project:focus-within a:visited {
  color: var(--accent-dark);
}

.project--flagship {
  grid-column: 1 / -1;
  background: var(--surface-elevated);
  padding: var(--space-5);
}

.project__name {
  margin-bottom: var(--space-2);
}

.project__desc {
  margin-bottom: var(--space-3);
}

.project__live {
  margin: var(--space-3) 0 0;
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
}

/* Tech tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-interactive);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 120ms ease, color 120ms ease;
}

.project--flagship .tag,
.project:hover .tag,
.project:focus-within .tag {
  color: var(--accent-dark);
}

/* Inverted state: colour PLUS background change (never colour alone) */
.tag:hover,
.project--flagship .tag:hover,
.project:hover .tag:hover,
.project:focus-within .tag:hover {
  background: var(--accent);
  color: var(--surface);
}

/* --------------------------------------------------------------------------
   Lists ("Şimdi", "İletişim")
   -------------------------------------------------------------------------- */

.focus-list li,
.contact-links li {
  margin-bottom: var(--space-2);
  padding-left: var(--space-4);
  position: relative;
}

.focus-list li::before,
.contact-links li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: var(--space-1);
  height: var(--space-1);
  background: var(--border);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.contact-links li {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: var(--space-6) var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Breakpoints
   -------------------------------------------------------------------------- */

/* ≤640px */
@media (max-width: 640px) {
  .section {
    padding: var(--space-7) var(--space-3);
  }

  .hero {
    padding: var(--space-7) var(--space-3) var(--space-6);
  }

  h1 {
    font-size: 2rem;
  }

  .hero__links {
    flex-direction: column;
    gap: var(--space-2);
  }

  .hero__links a {
    display: flex;
    align-items: center;
    min-height: 48px;
  }

  .project {
    padding: var(--space-3);
  }

  .project--flagship {
    padding: var(--space-4);
  }

  .site-footer {
    padding: var(--space-5) var(--space-3);
  }
}

/* 641–1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  .section {
    padding: var(--space-8) var(--space-5);
  }

  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ≥1025px */
@media (min-width: 1025px) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
