/* jameskhoury.com - one hand-written stylesheet, no framework */

/* ---------- colours: light by default, dark from the system setting or the switch ---------- */
:root {
	--accent: #ff8800;          /* brand orange: dots, rules, big text on dark */
	--accent-text: #aa5500;     /* orange dark enough for small text on light backgrounds (4.8:1 on the page, 5.2:1 on cards) */
	--bg: #f5f5f4;
	--surface: #ffffff;
	--text: #1f2328;
	--muted: #5b6168;
	--line: #e2e2e0;
	--tag-bg: #fff1e0;
	--tag-text: #8a4500;
	--shadow: 0 0 20px rgba(0, 0, 0, .15); /* the old site's soft all-round shadow */
	--band: #1b1d21;            /* highlights strip and footer: dark in both themes */
	--band-text: #c9ccd0;
	--radius: 0; /* square corners, as on the old site (James, 2026-10-22) */
	--field-radius: 4px; /* form fields only: slightly rounded */
	--field-bg: #fff;           /* white fields in light mode (James) */
	--field-text: #1f2328;
	--field-border: var(--line);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* which part of the header photo shows: lower % = higher up the photo = bridge sits lower */
	--banner-photo-y: 10%;
	color-scheme: light;
}

/* the same dark values twice: once for "follow the system", once for the switch */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--accent-text: #ffa64d;
		--bg: #111316;
		--surface: #1a1d21;
		--text: #e7e9ec;
		--muted: #a2a8b0;
		--line: #2b2f35;
		--tag-bg: rgba(255, 136, 0, .14);
		--tag-text: #ffb366;
		--shadow: 0 0 20px rgba(0, 0, 0, .6);
		--field-bg: #25292f;        /* a step lighter than the card, like white fields on the light page */
		--field-text: #e7e9ec;
		--field-border: #3a3f46;
		--band: #0b0c0e;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--accent-text: #ffa64d;
	--bg: #111316;
	--surface: #1a1d21;
	--text: #e7e9ec;
	--muted: #a2a8b0;
	--line: #2b2f35;
	--tag-bg: rgba(255, 136, 0, .14);
	--tag-text: #ffb366;
	--shadow: 0 0 20px rgba(0, 0, 0, .6);
	--field-bg: #25292f;
	--field-text: #e7e9ec;
	--field-border: #3a3f46;
	--band: #0b0c0e;
	color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	background: var(--bg);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.1em; height: 1.1em; vertical-align: -.15em; fill: currentColor; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; border-right: 3px solid var(--accent); }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 10; transition: background-color .3s, box-shadow .3s; }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; opacity: 0; transition: opacity .3s; }
.nav-brand:hover { color: #fff; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0 8px 0 0; padding: 0; }
.nav-links a {
	display: block; padding: 6px 0; border-bottom: 2px solid transparent;
	color: #fff; text-decoration: none; font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; line-height: 0; }
.nav-toggle:hover { color: var(--accent); }
.nav-toggle .icon { width: 24px; height: 24px; }

/* light/dark switch: small, faded, fixed in the bottom right corner */
.theme-toggle {
	position: fixed; right: 14px; bottom: 14px; z-index: 11;
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
	background: var(--surface); color: var(--muted); border: 1px solid var(--line);
	opacity: .5; transition: opacity .2s, color .2s;
}
.theme-toggle:hover, .theme-toggle:focus-visible { opacity: 1; color: var(--accent-text); }
.theme-toggle .icon { width: 16px; height: 16px; }
@media (max-width: 640px) { .theme-toggle { top: 13px; bottom: auto; right: 66px; opacity: .8; } }
/* show the icon of the theme the switch changes to */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: inline; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .icon-sun { display: inline; }
	:root:not([data-theme="light"]) .icon-moon { display: none; }
}
body.scrolled .nav { background: rgba(17, 19, 22, .92); box-shadow: 0 2px 12px rgba(0, 0, 0, .25); backdrop-filter: blur(6px); }
body.scrolled .nav-brand { opacity: 1; }

@media (max-width: 640px) {
	.nav-toggle { display: block; }
	.nav-brand { opacity: 1; }
	.nav-links {
		display: none; position: absolute; top: 60px; left: 0; right: 0; margin: 0;
		flex-direction: column; gap: 0; padding: 4px 20px 14px; background: rgba(17, 19, 22, .97);
	}
	.nav.open .nav-links { display: flex; }
	.nav-links a { padding: 12px 0; border-bottom: 0; }
}

/* ---------- banner ---------- */
.banner {
	position: relative; isolation: isolate;
	min-height: 46vh; display: grid; place-items: center; text-align: center;
	padding: 80px 0 36px; color: #fff;
	background: #222 url(/images/iStock-487329261-l.jpg) center var(--banner-photo-y) / cover no-repeat;
}
.banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .76)); }
@media (max-width: 1199px) { .banner { background-image: url(/images/iStock-487329261-m.jpg); } }
@media (max-width: 767px) { .banner { background-image: url(/images/iStock-487329261-s.jpg); } }
.avatar {
	width: 132px; height: 132px; border-radius: 50%; display: block; margin: 0 auto 18px;
	border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); object-fit: cover;
}
.banner h1 {
	font-size: clamp(24px, 4.4vw, 40px); font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
	min-height: 2.5em; margin: 0;
}
.banner h1 b { color: var(--accent); }
/* the longest typed line wraps below 1024px; reserve two lines there so the page doesn't jump */
@media (min-width: 1024px) { .banner h1 { min-height: 1.3em; } }
.caret { display: inline-block; width: 3px; height: .9em; margin-left: 4px; vertical-align: -.08em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- highlights strip (home) ---------- */
.highlights { background: var(--band); color: var(--band-text); padding: 30px 0; }
.highlights ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.highlights strong { display: block; color: var(--accent); font-size: clamp(26px, 3.4vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.highlights span { font-size: 15px; letter-spacing: .03em; }
@media (max-width: 640px) {
	.highlights { padding: 20px 0; }
	.highlights ul { gap: 8px; }
	.highlights strong { font-size: 20px; }
	.highlights span { display: block; font-size: 12px; line-height: 1.35; margin-top: 4px; }
}

/* ---------- page content ---------- */
main.container { padding-top: 72px; padding-bottom: 80px; }
.section-title { font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }
.section-title::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 10px; background: var(--accent); }

/* home */
.about { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
.more-link { display: inline-block; margin-top: 6px; font-weight: 700; }
.about figure { margin: 0; }
.about figure img { display: block; border-radius: var(--radius); box-shadow: var(--shadow); max-height: 500px; width: 100%; object-fit: cover; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; gap: 32px; } }

.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a {
	display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--line); color: var(--text); transition: color .2s, background-color .2s, border-color .2s;
}
.socials a:hover { color: #111; background: var(--accent); border-color: var(--accent); }
.socials .icon { width: 20px; height: 20px; }

/* work */
.work-intro { max-width: 760px; font-size: 18px; }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 36px 0 28px; }
.skills h3 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 820px) { .skills { grid-template-columns: 1fr; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { background: var(--tag-bg); color: var(--tag-text); font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius); line-height: 1.5; }
.elsewhere { display: flex; gap: 8px 24px; flex-wrap: wrap; margin: 0 0 56px; font-size: 15px; color: var(--muted); }

/* timeline: single column, years oldest first */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(rgba(255, 136, 0, .3), var(--accent)); }
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before {
	content: ""; position: absolute; left: -31px; top: 26px; width: 14px; height: 14px; border-radius: 50%;
	background: var(--bg); border: 3px solid var(--accent);
}
.tl-item.now::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(255, 136, 0, .25); }
.tl-years { font-size: 14px; font-weight: 800; letter-spacing: .08em; color: var(--accent-text); }
.tl-item h3 { font-size: 21px; margin: 2px 0; }
.tl-org { font-weight: 600; color: var(--muted); margin-bottom: 10px; font-size: 16px; }
.tl-item p { font-size: 16px; }
.tl-item .tags { margin-top: 4px; }
.tl-sub { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.tl-sub li { padding: 16px 0 0 18px; position: relative; }
.tl-sub li::before { content: ""; position: absolute; left: 0; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tl-sub h4 { font-size: 17px; margin: 0; }
.tl-sub .tl-years { font-size: 12px; }
.tl-sub p { margin: 4px 0 0; font-size: 15px; }

/* timeline "alt": entries alternate left and right on wide screens */
@media (min-width: 900px) {
	.timeline.alt { padding-left: 0; }
	.timeline.alt::before { left: 50%; margin-left: -1px; }
	.timeline.alt .tl-item { width: calc(50% - 32px); }
	.timeline.alt .tl-item:nth-child(even) { margin-left: calc(50% + 32px); }
	.timeline.alt .tl-item::before { left: auto; right: -39px; }
	.timeline.alt .tl-item:nth-child(even)::before { right: auto; left: -39px; }
	.timeline.alt .tl-item:nth-child(n+2) { margin-top: -60px; }
}

/* contact */
.contact { display: grid; grid-template-columns: .8fr 1.2fr; gap: 32px; align-items: start; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }
.contact h3 { font-size: 18px; }
.con-info { list-style: none; margin: 0 0 28px; padding: 0; }
/* each contact item (and the socials) in its own box, like the old site: shadow and an orange right edge */
.info-box {
	display: flex; gap: 14px; align-items: center; background: var(--surface); box-shadow: var(--shadow);
	border-right: 3px solid var(--accent); padding: 12px 16px; margin-bottom: 14px;
}
.icon-ring {
	flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	border: 1px solid var(--accent); color: var(--accent);
}
form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
form input, form textarea {
	width: 100%; font: inherit; font-size: 16px; color: var(--field-text); background: var(--field-bg);
	box-shadow: 0 0 10px rgba(0, 0, 0, .08);
	border: 1px solid var(--field-border); border-radius: var(--field-radius); padding: 10px 12px; margin-bottom: 16px;
}
form input:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
form button {
	font: inherit; font-weight: 700; letter-spacing: .04em; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
	vertical-align: top; /* same box height as the outlined Clear button, aligned by their tops */
	background: var(--accent); color: #111; padding: 10px 24px; display: inline-flex; gap: 8px; align-items: center;
}
form button:hover { filter: brightness(1.08); }
/* secondary button (Clear): outlined, turns orange on hover */
form button.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--line); margin-left: 8px; }
form button.btn-secondary:hover { filter: none; border-color: var(--accent); color: var(--accent-text); }
/* contact form honeypot: off-screen rather than display:none, which some bots skip */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#contact-status.sent, #contact-status.error { padding: 10px 15px; margin-bottom: 16px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: var(--radius); }
#contact-status.error { border-left-color: #d33; }

/* ---------- footer ---------- */
.site-footer { background: var(--band); color: #9aa0a6; text-align: center; padding: 34px 0 26px; font-size: 15px; }
.site-footer p { margin-bottom: 10px; }
.site-footer a { color: #dde0e3; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; justify-content: center; gap: 22px; }
.footer-links a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; }
.footer-links .icon { width: 22px; height: 22px; }

/* ---------- fade in on scroll (main.js adds .reveal only to elements that start below the fold) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
